tv replay
- fabrice_035
- Posts: 765
- Joined: Mon 28 Apr 2014, 17:54
- Location: Bretagne / France
tv replay
Hello,
Je me suis fait un utilitaire pour voir ou revoir des programmes diffusés à la tv française,
Je me suis fait un utilitaire pour voir ou revoir des programmes diffusés à la tv française,
Last edited by fabrice_035 on Sat 02 May 2015, 15:00, edited 1 time in total.
TV Replay, les navigateurs ok ou pas OK
Regroupons les infos sur le Pluzz
L'utilitaire a disparu ?
L'utilitaire a disparu ?
Bonsoir,
je ne sais pas si ca peut aider ,j'ai ce script que l'on peut lancer en ligne de commande : pluzz.py
A utiliser avec un ffmpeg recent.
je ne sais pas si ca peut aider ,j'ai ce script que l'on peut lancer en ligne de commande : pluzz.py
A utiliser avec un ffmpeg recent.
- Attachments
-
- pluzz.py.gz
- (751 Bytes) Downloaded 216 times
-
- Posts: 571
- Joined: Fri 25 Mar 2011, 20:10
- Location: France
python2 je ne sais pas , il faut avoir aussi youtube-dl d'installé , voici le code de ce script :
Code: Select all
#!/usr/bin/env python
# -*- coding: utf8 -*-
import urllib2
import json
from subprocess import call
response = urllib2.urlopen('http://pluzz.webservices.francetelevisions.fr/pluzz/liste/type/replay/nb/9999/debut/0')
data = json.load(response)
def get_channel_name(jsondata):
return sorted(list(set([channel_name['chaine_id'] for channel_name in jsondata])))
def get_avail_date(channel, jsondata):
return sorted(list(set([date["date_diffusion"].split('T')[0] for date in jsondata if date['chaine_id'] == channel])))
def get_tvshow(date, channel, jsondata):
return sorted(list(set([tvshow["titre"] for tvshow in jsondata if tvshow['chaine_id'] == channel and tvshow["date_diffusion"].split('T')[0] == date])))
def dl_video(title, date, channel, jsondata):
return [dl_link["url"] for dl_link in jsondata if dl_link["titre"] == title and dl_link['chaine_id'] == channel and dl_link["date_diffusion"].split('T')[0] == date]
def print_menu(result):
print (30 * '-')
print ("SELECTION")
print (30 * '-')
for entry in result:
print str(result.index(entry)) + ". " + entry
print (30 * '-')
choice = raw_input('Enter your choice [0-'+str(len(result)-1)+'] : ')
choice = int(choice)
return choice
result = get_channel_name(data["reponse"]["emissions"]);
choice_channel = print_menu(result)
#for texte in data["reponse"]["emissions"]:
# print texte['chaine_id']+' - '+texte["date_diffusion"]+' : \t'+texte["titre"]+" ("+texte['url']+")"
dateresult = get_avail_date(result[choice_channel], data["reponse"]["emissions"]);
choice_date = print_menu(dateresult)
tvshowresult = get_tvshow(dateresult[choice_date], result[choice_channel], data["reponse"]["emissions"]);
choice_tvshow = print_menu(tvshowresult)
urldl = dl_video(tvshowresult[choice_tvshow], dateresult[choice_date], result[choice_channel], data["reponse"]["emissions"]);
for entry in urldl:
print ("http://pluzz.francetv.fr"+str(entry))
call(["youtube-dl", "http://pluzz.francetv.fr"+str(entry)])