1 from __future__ import unicode_literals
5 from .common import InfoExtractor
13 class JukeboxIE(InfoExtractor):
14 _VALID_URL = r'^http://www\.jukebox?\..+?\/.+[,](?P<id>[a-z0-9\-]+)\.html'
16 'url': 'http://www.jukebox.es/kosheen/videoclip,pride,r303r.html',
20 'title': 'Kosheen-En Vivo Pride',
21 'uploader': 'Kosheen',
25 def _real_extract(self, url):
26 video_id = self._match_id(url)
28 html = self._download_webpage(url, video_id)
29 iframe_url = unescapeHTML(self._search_regex(r'<iframe .*src="([^"]*)"', html, 'iframe url'))
31 iframe_html = self._download_webpage(iframe_url, video_id, 'Downloading iframe')
32 if re.search(r'class="jkb_waiting"', iframe_html) is not None:
33 raise ExtractorError('Video is not available(in your country?)!')
35 self.report_extraction(video_id)
38 video_url = self._search_regex(r'"config":{"file":"(?P<video_url>http:[^"]+\?mdtk=[0-9]+)"',
39 iframe_html, 'video url')
40 video_url = unescapeHTML(video_url).replace('\/', '/')
41 except RegexNotFoundError:
42 youtube_url = self._search_regex(
43 r'config":{"file":"(http:\\/\\/www\.youtube\.com\\/watch\?v=[^"]+)"',
44 iframe_html, 'youtube url')
45 youtube_url = unescapeHTML(youtube_url).replace('\/', '/')
46 self.to_screen('Youtube video detected')
47 return self.url_result(youtube_url, ie='Youtube')
49 title = self._html_search_regex(r'<h1 class="inline">([^<]+)</h1>',
51 artist = self._html_search_regex(r'<span id="infos_article_artist">([^<]+)</span>',
57 'title': artist + '-' + title,