]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/muzu.py
4 from .common
import InfoExtractor
11 class MuzuTVIE(InfoExtractor
):
12 _VALID_URL
= r
'https?://www\.muzu\.tv/(.+?)/(.+?)/(?P<id>\d+)'
16 u
'url': u
'http://www.muzu.tv/defected/marcashken-featuring-sos-cat-walk-original-mix-music-video/1981454/',
17 u
'file': u
'1981454.mp4',
18 u
'md5': u
'98f8b2c7bc50578d6a0364fff2bfb000',
20 u
'title': u
'Cat Walk (Original Mix)',
21 u
'description': u
'md5:90e868994de201b2570e4e5854e19420',
22 u
'uploader': u
'MarcAshken featuring SOS',
26 def _real_extract(self
, url
):
27 mobj
= re
.match(self
._VALID
_URL
, url
)
28 video_id
= mobj
.group('id')
30 info_data
= compat_urllib_parse
.urlencode({'format': 'json',
33 video_info_page
= self
._download
_webpage
('http://www.muzu.tv/api/oembed/?%s' % info_data
,
34 video_id
, u
'Downloading video info')
35 info
= json
.loads(video_info_page
)
37 player_info_page
= self
._download
_webpage
('http://player.muzu.tv/player/playerInit?ai=%s' % video_id
,
38 video_id
, u
'Downloading player info')
39 video_info
= json
.loads(player_info_page
)['videos'][0]
40 for quality
in ['1080' , '720', '480', '360']:
41 if video_info
.get('v%s' % quality
):
44 data
= compat_urllib_parse
.urlencode({'ai': video_id
,
45 # Even if each time you watch a video the hash changes,
46 # it seems to work for different videos, and it will work
47 # even if you use any non empty string as a hash
48 'viewhash': 'VBNff6djeV4HV5TRPW5kOHub2k',
52 video_url_page
= self
._download
_webpage
('http://player.muzu.tv/player/requestVideo?%s' % data
,
53 video_id
, u
'Downloading video url')
54 video_url_info
= json
.loads(video_url_page
)
55 video_url
= video_url_info
['url']
57 return {'id': video_id
,
58 'title': info
['title'],
60 'ext': determine_ext(video_url
),
61 'thumbnail': info
['thumbnail_url'],
62 'description': info
['description'],
63 'uploader': info
['author_name'],