2 from __future__ import unicode_literals
6 from .common import InfoExtractor
15 class RTL2IE(InfoExtractor):
16 """Information Extractor for RTL2"""
17 _VALID_URL = r'http?://(?P<url>(?P<domain>(www\.)?rtl2\.de)/.*/(?P<video_id>.*))/'
19 'url': 'http://www.rtl2.de/sendung/grip-das-motormagazin/folge/folge-203-0',
23 'title': 'GRIP sucht den Sommerkönig',
24 'description' : 'Matthias, Det und Helge treten gegeneinander an.'
28 'skip_download': True,
32 'url': 'http://www.rtl2.de/sendung/koeln-50667/video/5512-anna/21040-anna-erwischt-alex/',
34 'id': '21040-anna-erwischt-alex',
36 'title': 'Anna erwischt Alex!',
37 'description' : 'Anna ist Alex\' Tochter bei Köln 50667.'
41 'skip_download': True,
46 def _real_extract(self, url):
48 #Some rtl2 urls have no slash at the end, so append it.
49 if not url.endswith("/"):
52 mobj = re.match(self._VALID_URL, url)
53 video_id = mobj.group('video_id')
55 webpage = self._download_webpage(url, video_id)
57 vico_id = self._html_search_regex(r'vico_id\s*:\s*([0-9]+)', webpage, 'vico_id not found');
58 vivi_id = self._html_search_regex(r'vivi_id\s*:\s*([0-9]+)', webpage, 'vivi_id not found');
60 info_url = 'http://www.rtl2.de/video/php/get_video.php?vico_id=' + vico_id + '&vivi_id=' + vivi_id
61 webpage = self._download_webpage(info_url, '')
63 video_info = self._download_json(info_url, video_id)
65 download_url = video_info["video"]["streamurl"]
66 title = video_info["video"]["titel"]
67 description = video_info["video"]["beschreibung"]
69 thumbnail = video_info["video"]["image"]
71 download_url = download_url.replace("\\", "")
73 stream_url = 'mp4:' + self._html_search_regex(r'ondemand/(.*)', download_url, '%s')
77 #print('DL URL: ' + download_url)
78 #print('Stream URL: ' + stream_url)
79 #print('Title: ' + title)
80 #print('Description: '+ description)
81 #print('Video ID: ' + video_id)
85 #'app': 'ondemand?_fcs_vhost=cp108781.edgefcs.net',
86 'play_path': stream_url,
87 'player_url': 'http://www.rtl2.de/flashplayer/vipo_player.swf',
89 'flash_version' : "LNX 11,2,202,429",
90 'rtmp_conn' : ["S:connect", "O:1", "NS:pageUrl:" + url, "NB:fpad:0", "NN:videoFunction:1", "O:0"],
97 'thumbnail' : thumbnail,
98 'description' : description,