4 from .common import InfoExtractor
10 class RTLnowIE(InfoExtractor):
11 """Information Extractor for RTL NOW, RTL2 NOW, SUPER RTL NOW and VOX NOW"""
12 _VALID_URL = r'(?:http://)?(?P<url>(?P<base_url>rtl-now\.rtl\.de/|rtl2now\.rtl2\.de/|(?:www\.)?voxnow\.de/|(?:www\.)?superrtlnow\.de/)[a-zA-Z0-9-]+/[a-zA-Z0-9-]+\.php\?(?:container_id|film_id)=(?P<video_id>[0-9]+)&player=1(?:&season=[0-9]+)?(?:&.*)?)'
14 u'url': u'http://rtl-now.rtl.de/ahornallee/folge-1.php?film_id=90419&player=1&season=1',
15 u'file': u'90419.flv',
17 u'upload_date': u'20070416',
18 u'title': u'Ahornallee - Folge 1 - Der Einzug',
19 u'description': u'Folge 1 - Der Einzug',
22 u'skip_download': True,
24 u'skip': u'Only works from Germany',
27 u'url': u'http://rtl2now.rtl2.de/aerger-im-revier/episode-15-teil-1.php?film_id=69756&player=1&season=2&index=5',
28 u'file': u'69756.flv',
30 u'upload_date': u'20120519',
31 u'title': u'Ärger im Revier - Ein junger Ladendieb, ein handfester Streit...',
32 u'description': u'Ärger im Revier - Ein junger Ladendieb, ein handfester Streit u.a.',
33 u'thumbnail': u'http://autoimg.static-fra.de/rtl2now/219850/1500x1500/image2.jpg',
36 u'skip_download': True,
38 u'skip': u'Only works from Germany',
41 u'url': u'www.voxnow.de/voxtours/suedafrika-reporter-ii.php?film_id=13883&player=1&season=17',
42 u'file': u'13883.flv',
44 u'upload_date': u'20090627',
45 u'title': u'Voxtours - Südafrika-Reporter II',
46 u'description': u'Südafrika-Reporter II',
49 u'skip_download': True,
53 u'url': u'http://superrtlnow.de/medicopter-117/angst.php?film_id=99205&player=1',
54 u'file': u'99205.flv',
56 u'upload_date': u'20080928',
57 u'title': u'Medicopter 117 - Angst!',
58 u'description': u'Angst!',
59 u'thumbnail': u'http://autoimg.static-fra.de/superrtlnow/287529/1500x1500/image2.jpg'
62 u'skip_download': True,
66 def _real_extract(self,url):
67 mobj = re.match(self._VALID_URL, url)
69 webpage_url = u'http://' + mobj.group('url')
70 video_page_url = u'http://' + mobj.group('base_url')
71 video_id = mobj.group(u'video_id')
73 webpage = self._download_webpage(webpage_url, video_id)
75 note_m = re.search(r'''(?sx)
76 <div[ ]style="margin-left:[ ]20px;[ ]font-size:[ ]13px;">(.*?)
77 <div[ ]id="playerteaser">''', webpage)
79 msg = clean_html(note_m.group(1))
80 raise ExtractorError(msg)
82 video_title = self._html_search_regex(r'<title>(?P<title>[^<]+)</title>',
84 playerdata_url = self._html_search_regex(r'\'playerdata\': \'(?P<playerdata_url>[^\']+)\'',
85 webpage, u'playerdata_url')
87 playerdata = self._download_webpage(playerdata_url, video_id)
88 mobj = re.search(r'<title><!\[CDATA\[(?P<description>.+?)\s+- (?:Sendung )?vom (?P<upload_date_d>[0-9]{2})\.(?P<upload_date_m>[0-9]{2})\.(?:(?P<upload_date_Y>[0-9]{4})|(?P<upload_date_y>[0-9]{2})) [0-9]{2}:[0-9]{2} Uhr\]\]></title>', playerdata)
90 video_description = mobj.group(u'description')
91 if mobj.group('upload_date_Y'):
92 video_upload_date = mobj.group('upload_date_Y')
94 video_upload_date = u'20' + mobj.group('upload_date_y')
95 video_upload_date += mobj.group('upload_date_m')+mobj.group('upload_date_d')
97 video_description = None
98 video_upload_date = None
99 self._downloader.report_warning(u'Unable to extract description and upload date')
101 # Thumbnail: not every video has an thumbnail
102 mobj = re.search(r'<meta property="og:image" content="(?P<thumbnail>[^"]+)">', webpage)
104 video_thumbnail = mobj.group(u'thumbnail')
106 video_thumbnail = None
108 mobj = re.search(r'<filename [^>]+><!\[CDATA\[(?P<url>rtmpe://(?:[^/]+/){2})(?P<play_path>[^\]]+)\]\]></filename>', playerdata)
110 raise ExtractorError(u'Unable to extract media URL')
111 video_url = mobj.group(u'url')
112 video_play_path = u'mp4:' + mobj.group(u'play_path')
113 video_player_url = video_page_url + u'includes/vodplayer.swf'
118 'play_path': video_play_path,
119 'page_url': video_page_url,
120 'player_url': video_player_url,
122 'title': video_title,
123 'description': video_description,
124 'upload_date': video_upload_date,
125 'thumbnail': video_thumbnail,