1 from __future__
import unicode_literals
3 from .common
import InfoExtractor
4 from ..compat
import compat_urllib_parse_urlencode
7 class MuzuTVIE(InfoExtractor
):
8 _VALID_URL
= r
'https?://www\.muzu\.tv/(.+?)/(.+?)/(?P<id>\d+)'
12 'url': 'http://www.muzu.tv/defected/marcashken-featuring-sos-cat-walk-original-mix-music-video/1981454/',
13 'md5': '98f8b2c7bc50578d6a0364fff2bfb000',
17 'title': 'Cat Walk (Original Mix)',
18 'description': 'md5:90e868994de201b2570e4e5854e19420',
19 'uploader': 'MarcAshken featuring SOS',
23 def _real_extract(self
, url
):
24 video_id
= self
._match
_id
(url
)
26 info_data
= compat_urllib_parse_urlencode({
30 info
= self
._download
_json
(
31 'http://www.muzu.tv/api/oembed/?%s' % info_data
,
32 video_id
, 'Downloading video info')
34 player_info
= self
._download
_json
(
35 'http://player.muzu.tv/player/playerInit?ai=%s' % video_id
,
36 video_id
, 'Downloading player info')
37 video_info
= player_info
['videos'][0]
38 for quality
in ['1080', '720', '480', '360']:
39 if video_info
.get('v%s' % quality
):
42 data
= compat_urllib_parse_urlencode({
44 # Even if each time you watch a video the hash changes,
45 # it seems to work for different videos, and it will work
46 # even if you use any non empty string as a hash
47 'viewhash': 'VBNff6djeV4HV5TRPW5kOHub2k',
51 video_url_info
= self
._download
_json
(
52 'http://player.muzu.tv/player/requestVideo?%s' % data
,
53 video_id
, 'Downloading video url')
54 video_url
= video_url_info
['url']
58 'title': info
['title'],
60 'thumbnail': info
['thumbnail_url'],
61 'description': info
['description'],
62 'uploader': info
['author_name'],