]>
Commit | Line | Data |
---|---|---|
71c107fc | 1 | import re,random |
2 | ||
3 | from .common import InfoExtractor | |
4 | from ..utils import ( | |
5 | determine_ext, | |
6 | ) | |
7 | ||
8 | class FKTVIE(InfoExtractor): | |
9 | """Information Extractor for Fernsehkritik-TV""" | |
10 | _VALID_URL = r'(?:http://)?(?:www\.)?fernsehkritik.tv/folge-(?P<ep>[0-9]+)(?:/.*)?' | |
11 | ||
12 | def _real_extract(self,url): | |
13 | mobj = re.match(self._VALID_URL, url) | |
14 | episode = int(mobj.group('ep')) | |
15 | ||
16 | server = random.randint(2,4) | |
17 | video_thumbnail = 'http://fernsehkritik.tv/images/magazin/folge%d.jpg' % episode | |
18 | videos = [] | |
19 | # Download all three parts | |
20 | for i in range(1,4): | |
21 | video_id = '%04d%d' % (episode, i) | |
22 | video_url = 'http://dl%d.fernsehkritik.tv/fernsehkritik%d%s.flv' % (server, episode, '' if i==1 else '-%d'%i) | |
23 | video_title = 'Fernsehkritik %d.%d' % (episode, i) | |
24 | videos.append({ | |
25 | 'id': video_id, | |
26 | 'url': video_url, | |
27 | 'ext': determine_ext(video_url), | |
28 | 'title': video_title, | |
29 | 'thumbnail': video_thumbnail | |
30 | }) | |
31 | return videos | |
32 | ||
33 | class FKTVPosteckeIE(InfoExtractor): | |
34 | """Information Extractor for Fernsehkritik-TV Postecke""" | |
35 | _VALID_URL = r'(?:http://)?(?:www\.)?fernsehkritik.tv/inline-video/postecke.php\?(.*&)?ep=(?P<ep>[0-9]+)(&|$)' | |
36 | _TEST = { | |
37 | u'url': u'http://fernsehkritik.tv/inline-video/postecke.php?iframe=true&width=625&height=440&ep=120', | |
38 | u'file': u'0120.flv', | |
39 | u'md5': u'262f0adbac80317412f7e57b4808e5c4', | |
40 | u'info_dict': { | |
41 | u"title": u"Postecke 120" | |
42 | } | |
43 | } | |
44 | ||
45 | def _real_extract(self,url): | |
46 | mobj = re.match(self._VALID_URL, url) | |
47 | episode = int(mobj.group('ep')) | |
48 | ||
49 | server = random.randint(2,4) | |
50 | video_id = '%04d' % episode | |
51 | video_url = 'http://dl%d.fernsehkritik.tv/postecke/postecke%d.flv' % (server, episode) | |
52 | video_title = 'Postecke %d' % episode | |
53 | return[{ | |
54 | 'id': video_id, | |
55 | 'url': video_url, | |
56 | 'ext': determine_ext(video_url), | |
57 | 'title': video_title, | |
58 | }] |