]>
jfr.im git - yt-dlp.git/blob - youtube_dl/extractor/fktv.py
1 from __future__
import unicode_literals
7 from .common
import InfoExtractor
15 class FKTVIE(InfoExtractor
):
16 IE_NAME
= 'fernsehkritik.tv'
17 _VALID_URL
= r
'http://(?:www\.)?fernsehkritik\.tv/folge-(?P<ep>[0-9]+)(?:/.*)?'
20 'url': 'http://fernsehkritik.tv/folge-1',
24 'title': 'Folge 1 vom 10. April 2007',
25 'description': 'md5:fb4818139c7cfe6907d4b83412a6864f',
29 def _real_extract(self
, url
):
30 mobj
= re
.match(self
._VALID
_URL
, url
)
31 episode
= int(mobj
.group('ep'))
33 server
= random
.randint(2, 4)
34 video_thumbnail
= 'http://fernsehkritik.tv/images/magazin/folge%d.jpg' % episode
35 start_webpage
= self
._download
_webpage
('http://fernsehkritik.tv/folge-%d/Start' % episode
,
37 playlist
= self
._search
_regex
(r
'playlist = (\[.*?\]);', start_webpage
,
38 'playlist', flags
=re
.DOTALL
)
39 files
= json
.loads(re
.sub('{[^{}]*?}', '{}', playlist
))
40 # TODO: return a single multipart video
42 for i
, _
in enumerate(files
, 1):
43 video_id
= '%04d%d' % (episode
, i
)
44 video_url
= 'http://dl%d.fernsehkritik.tv/fernsehkritik%d%s.flv' % (server
, episode
, '' if i
== 1 else '-%d' % i
)
48 'title': clean_html(get_element_by_id('eptitle', start_webpage
)),
49 'description': clean_html(get_element_by_id('contentlist', start_webpage
)),
50 'thumbnail': video_thumbnail
55 class FKTVPosteckeIE(InfoExtractor
):
56 IE_NAME
= 'fernsehkritik.tv:postecke'
57 _VALID_URL
= r
'http://(?:www\.)?fernsehkritik\.tv/inline-video/postecke\.php\?(.*&)?ep=(?P<ep>[0-9]+)(&|$)'
59 'url': 'http://fernsehkritik.tv/inline-video/postecke.php?iframe=true&width=625&height=440&ep=120',
60 'md5': '262f0adbac80317412f7e57b4808e5c4',
64 'title': 'Postecke 120',
68 def _real_extract(self
, url
):
69 mobj
= re
.match(self
._VALID
_URL
, url
)
70 episode
= int(mobj
.group('ep'))
72 server
= random
.randint(2, 4)
73 video_id
= '%04d' % episode
74 video_url
= 'http://dl%d.fernsehkritik.tv/postecke/postecke%d.flv' % (server
, episode
)
75 video_title
= 'Postecke %d' % episode