removed print statement
[youtube-dl] / youtube_dl / extractor / hotnewhiphop.py
1 import re
2 import base64
3
4 from .common import InfoExtractor
5
6
7 class 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
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