4 from .common import InfoExtractor
7 class HotNewHipHopIE(InfoExtractor):
8 _VALID_URL = r'(http://www\.hotnewhiphop.com/.*\.(?P<id>.*)\.html)'
9 IE_NAME = u'HotNewHipHop'
11 def _real_extract(self, url):
12 m = re.match(self._VALID_URL, url)
13 video_id = m.group('id')
15 webpage_src = self._download_webpage(url, video_id)
17 video_url_base64 = self._search_regex(r'data-path="(.*?)"',
18 webpage_src, u'video URL', fatal=False)
20 if video_url_base64 == None:
21 video_url = self._search_regex(r'"contentUrl" content="(.*?)"', webpage_src,
23 return self.url_result(video_url, ie='Youtube')
25 video_url = base64.b64decode(video_url_base64)
27 video_title = self._html_search_regex(r"<title>(.*)</title>",
28 webpage_src, u'title')
31 # Getting thumbnail and if not thumbnail sets correct title for WSHH candy video.
32 thumbnail = self._html_search_regex(r'"og:image" content="(.*)"',
33 webpage_src, u'thumbnail', fatal=False)
38 'title' : video_title,
39 'thumbnail' : thumbnail,