]>
jfr.im git - yt-dlp.git/blob - youtube_dl/extractor/fktv.py
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
)
45 'ext': determine_ext(video_url
),
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
53 class FKTVPosteckeIE(InfoExtractor
):
54 IE_NAME
= u
'fernsehkritik.tv:postecke'
55 _VALID_URL
= r
'(?:http://)?(?:www\.)?fernsehkritik.tv/inline-video/postecke.php\?(.*&)?ep=(?P<ep>[0-9]+)(&|$)'
57 u
'url': u
'http://fernsehkritik.tv/inline-video/postecke.php?iframe=true&width=625&height=440&ep=120',
59 u
'md5': u
'262f0adbac80317412f7e57b4808e5c4',
61 u
"title": u
"Postecke 120"
65 def _real_extract(self
, url
):
66 mobj
= re
.match(self
._VALID
_URL
, url
)
67 episode
= int(mobj
.group('ep'))
69 server
= random
.randint(2, 4)
70 video_id
= '%04d' % episode
71 video_url
= 'http://dl%d.fernsehkritik.tv/postecke/postecke%d.flv' % (server
, episode
)
72 video_title
= 'Postecke %d' % episode
76 'ext': determine_ext(video_url
),