]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/fktv.py
190d9f9adc292bfc33d2085eb9bd057ec4c95502
1 from __future__
import unicode_literals
7 from .common
import InfoExtractor
14 class FKTVIE(InfoExtractor
):
15 IE_NAME
= 'fernsehkritik.tv'
16 _VALID_URL
= r
'http://(?:www\.)?fernsehkritik\.tv/folge-(?P<id>[0-9]+)(?:/.*)?'
19 'url': 'http://fernsehkritik.tv/folge-1',
23 'title': 'Folge 1 vom 10. April 2007',
24 'description': 'md5:fb4818139c7cfe6907d4b83412a6864f',
28 def _real_extract(self
, url
):
29 episode
= int(self
._match
_id
(url
))
31 video_thumbnail
= 'http://fernsehkritik.tv/images/magazin/folge%s.jpg' % episode
32 start_webpage
= self
._download
_webpage
('http://fernsehkritik.tv/folge-%s/Start' % episode
,
34 playlist
= self
._search
_regex
(r
'playlist = (\[.*?\]);', start_webpage
,
35 'playlist', flags
=re
.DOTALL
)
36 files
= json
.loads(re
.sub('{[^{}]*?}', '{}', playlist
))
39 for i
, _
in enumerate(files
, 1):
40 video_id
= '%04d%d' % (episode
, i
)
41 video_url
= 'http://fernsehkritik.tv/js/directme.php?file=%s%s.flv' % (episode
, '' if i
== 1 else '-%d' % i
)
46 'title': clean_html(get_element_by_id('eptitle', start_webpage
)),
47 'description': clean_html(get_element_by_id('contentlist', start_webpage
)),
48 'thumbnail': video_thumbnail
51 '_type': 'multi_video',
53 'id': 'folge-%s' % episode
,
57 class FKTVPosteckeIE(InfoExtractor
):
58 IE_NAME
= 'fernsehkritik.tv:postecke'
59 _VALID_URL
= r
'http://(?:www\.)?fernsehkritik\.tv/inline-video/postecke\.php\?(.*&)?ep=(?P<ep>[0-9]+)(&|$)'
61 'url': 'http://fernsehkritik.tv/inline-video/postecke.php?iframe=true&width=625&height=440&ep=120',
62 'md5': '262f0adbac80317412f7e57b4808e5c4',
66 'title': 'Postecke 120',
70 def _real_extract(self
, url
):
71 mobj
= re
.match(self
._VALID
_URL
, url
)
72 episode
= int(mobj
.group('ep'))
74 server
= random
.randint(2, 4)
75 video_id
= '%04d' % episode
76 video_url
= 'http://dl%d.fernsehkritik.tv/postecke/postecke%d.flv' % (server
, episode
)
77 video_title
= 'Postecke %d' % episode