- mobj = re.search(self._VIDEO_URL, iframe_html)
- if mobj is None:
- mobj = re.search(self._IS_YOUTUBE, iframe_html)
- if mobj is None:
- raise ExtractorError(u'Cannot extract video url')
- youtube_url = unescapeHTML(mobj.group('youtube_url')).replace('\/','/')
- self.to_screen(u'Youtube video detected')
- return self.url_result(youtube_url,ie='Youtube')
- video_url = unescapeHTML(mobj.group('video_url')).replace('\/','/')
- video_ext = unescapeHTML(mobj.group('video_ext'))
-
- mobj = re.search(self._TITLE, html)
- if mobj is None:
- raise ExtractorError(u'Cannot extract title')
- title = unescapeHTML(mobj.group('title'))
- artist = unescapeHTML(mobj.group('artist'))
-
- return [{'id': video_id,
- 'url': video_url,
- 'title': artist + '-' + title,
- 'ext': video_ext
- }]
+ try:
+ video_url = self._search_regex(r'"config":{"file":"(?P<video_url>http:[^"]+\?mdtk=[0-9]+)"',
+ iframe_html, 'video url')
+ video_url = unescapeHTML(video_url).replace('\/', '/')
+ except RegexNotFoundError:
+ youtube_url = self._search_regex(
+ r'config":{"file":"(http:\\/\\/www\.youtube\.com\\/watch\?v=[^"]+)"',
+ iframe_html, 'youtube url')
+ youtube_url = unescapeHTML(youtube_url).replace('\/', '/')
+ self.to_screen('Youtube video detected')
+ return self.url_result(youtube_url, ie='Youtube')
+
+ title = self._html_search_regex(r'<h1 class="inline">([^<]+)</h1>',
+ html, 'title')
+ artist = self._html_search_regex(r'<span id="infos_article_artist">([^<]+)</span>',
+ html, 'artist')
+
+ return {
+ 'id': video_id,
+ 'url': video_url,
+ 'title': artist + '-' + title,
+ 'uploader': artist,
+ }