]> jfr.im git - yt-dlp.git/blame - youtube_dl/extractor/hotnewhiphop.py
removed print statement
[yt-dlp.git] / youtube_dl / extractor / hotnewhiphop.py
CommitLineData
5b66de88
JMS
1import re
2import base64
3
4from .common import InfoExtractor
5
6
7class HotNewHipHopIE(InfoExtractor):
8 _VALID_URL = r'(http://www\.hotnewhiphop.com/.*\.(?P<id>.*)\.html)'
9 IE_NAME = u'HotNewHipHop'
10
11 def _real_extract(self, url):
12 m = re.match(self._VALID_URL, url)
13 video_id = m.group('id')
14
15 webpage_src = self._download_webpage(url, video_id)
16
5b66de88
JMS
17 video_url_base64 = self._search_regex(r'data-path="(.*?)"',
18 webpage_src, u'video URL')
19
20 video_url = base64.b64decode(video_url_base64)
21
22 video_title = self._html_search_regex(r"<title>(.*)</title>",
23 webpage_src, u'title')
24
25 #"og:image" content=
26 # Getting thumbnail and if not thumbnail sets correct title for WSHH candy video.
27 thumbnail = self._html_search_regex(r'"og:image" content="(.*)"',
28 webpage_src, u'thumbnail', fatal=False)
29
30 results = [{
31 'id': video_id,
32 'url' : video_url,
33 'title' : video_title,
34 'thumbnail' : thumbnail,
35 'ext' : 'mp3',
36 }]
37 return results