2 from __future__ import unicode_literals
7 from .common import InfoExtractor
16 class RTL2IE(InfoExtractor):
17 """Information Extractor for RTL NOW, RTL2 NOW, RTL NITRO, SUPER RTL NOW, VOX NOW and n-tv NOW"""
18 _VALID_URL = r'http?://(?P<url>(?P<domain>(www\.)?rtl2\.de)/.*/(?P<video_id>.*))'
20 'url': 'http://www.rtl2.de/sendung/grip-das-motormagazin/folge/folge-203-0',
25 'title': 'GRIP sucht den Sommerk\xf6nig',
26 'description' : 'Matthias, Det und Helge treten gegeneinander an.'
27 # TODO more properties, either as:
29 # * MD5 checksum; start the string with md5:
30 # * A regular expression; start the string with re:
31 # * Any Python type (for example int or float)
35 # 'skip_download': True,
39 def _real_extract(self, url):
40 mobj = re.match(self._VALID_URL, url)
41 video_page_url = 'http://%s/' % mobj.group('domain')
42 video_id = mobj.group('video_id')
44 webpage = self._download_webpage('http://' + mobj.group('url'), video_id)
46 vico_id = self._html_search_regex(r'vico_id: ([0-9]+)', webpage, '%s');
47 vivi_id = self._html_search_regex(r'vivi_id: ([0-9]+)', webpage, '%s');
49 info_url = 'http://www.rtl2.de/video/php/get_video.php?vico_id=' + vico_id + '&vivi_id=' + vivi_id
50 webpage = self._download_webpage(info_url, '')
52 video_info = json.loads(webpage.decode("latin1"))
56 #self._download_webpage('http://cp108781.edgefcs.net/crossdomain.xml', '')
58 download_url = video_info["video"]["streamurl"] # self._html_search_regex(r'streamurl\":\"(.*?)\"', webpage, '%s');
59 title = video_info["video"]["titel"] # self._html_search_regex(r'titel\":\"(.*?)\"', webpage, '%s');
60 description = video_info["video"]["beschreibung"] # self._html_search_regex(r'beschreibung\":\"(.*?)\"', webpage, '%s');
61 #ext = self._html_search_regex(r'streamurl\":\".*?(\..{2,4})\"', webpage, '%s');
63 thumbnail = video_info["video"]["image"]
65 download_url = download_url.replace("\\", "")
67 stream_url = 'mp4:' + self._html_search_regex(r'ondemand/(.*)', download_url, '%s');
69 #upload_date = self._html_search_regex(r'property=\"dc:date\".*?datatype=\"xsd:dateTime\".*?content=\"(.*?)\"', webpage, 'title')
70 #download_url += " -y " + stream_url
82 #'app': 'ondemand?_fcs_vhost=cp108781.edgefcs.net',
83 'play_path': stream_url,
84 #'player_url': 'http://www.cbsnews.com/[[IMPORT]]/vidtech.cbsinteractive.com/player/3_3_0/CBSI_PLAYER_HD.swf',
85 #'page_url': 'http://www.cbsnews.com',
95 'thumbnail' : thumbnail,
96 'description' : description,