]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/fktv.py
9c89362efafefbb22c4dd5e4ef73950446fe9246
5 from .common
import InfoExtractor
13 class FKTVIE(InfoExtractor
):
14 IE_NAME
= u
'fernsehkritik.tv'
15 _VALID_URL
= r
'(?:http://)?(?:www\.)?fernsehkritik.tv/folge-(?P<ep>[0-9]+)(?:/.*)?'
18 u
'url': u
'http://fernsehkritik.tv/folge-1',
19 u
'file': u
'00011.flv',
21 u
'title': u
'Folge 1 vom 10. April 2007',
22 u
'description': u
'md5:fb4818139c7cfe6907d4b83412a6864f',
26 def _real_extract(self
, url
):
27 mobj
= re
.match(self
._VALID
_URL
, url
)
28 episode
= int(mobj
.group('ep'))
30 server
= random
.randint(2, 4)
31 video_thumbnail
= 'http://fernsehkritik.tv/images/magazin/folge%d.jpg' % episode
32 start_webpage
= self
._download
_webpage
('http://fernsehkritik.tv/folge-%d/Start' % episode
,
34 playlist
= self
._search
_regex
(r
'playlist = (\[.*?\]);', start_webpage
,
35 u
'playlist', flags
=re
.DOTALL
)
36 files
= json
.loads(re
.sub('{[^{}]*?}', '{}', playlist
))
37 # TODO: return a single multipart video
39 for i
, _
in enumerate(files
, 1):
40 video_id
= '%04d%d' % (episode
, i
)
41 video_url
= 'http://dl%d.fernsehkritik.tv/fernsehkritik%d%s.flv' % (server
, episode
, '' if i
== 1 else '-%d' % i
)
42 video_title
= 'Fernsehkritik %d.%d' % (episode
, i
)
46 'ext': determine_ext(video_url
),
47 'title': clean_html(get_element_by_id('eptitle', start_webpage
)),
48 'description': clean_html(get_element_by_id('contentlist', start_webpage
)),
49 'thumbnail': video_thumbnail
54 class FKTVPosteckeIE(InfoExtractor
):
55 IE_NAME
= u
'fernsehkritik.tv:postecke'
56 _VALID_URL
= r
'(?:http://)?(?:www\.)?fernsehkritik.tv/inline-video/postecke.php\?(.*&)?ep=(?P<ep>[0-9]+)(&|$)'
58 u
'url': u
'http://fernsehkritik.tv/inline-video/postecke.php?iframe=true&width=625&height=440&ep=120',
60 u
'md5': u
'262f0adbac80317412f7e57b4808e5c4',
62 u
"title": u
"Postecke 120"
66 def _real_extract(self
, url
):
67 mobj
= re
.match(self
._VALID
_URL
, url
)
68 episode
= int(mobj
.group('ep'))
70 server
= random
.randint(2, 4)
71 video_id
= '%04d' % episode
72 video_url
= 'http://dl%d.fernsehkritik.tv/postecke/postecke%d.flv' % (server
, episode
)
73 video_title
= 'Postecke %d' % episode
77 'ext': determine_ext(video_url
),