]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/muzu.py
   1 from __future__ 
import unicode_literals
 
   3 from .common 
import InfoExtractor
 
   9 class MuzuTVIE(InfoExtractor
): 
  10     _VALID_URL 
= r
'https?://www\.muzu\.tv/(.+?)/(.+?)/(?P<id>\d+)' 
  14         'url': 'http://www.muzu.tv/defected/marcashken-featuring-sos-cat-walk-original-mix-music-video/1981454/', 
  15         'md5': '98f8b2c7bc50578d6a0364fff2bfb000', 
  19             'title': 'Cat Walk (Original Mix)', 
  20             'description': 'md5:90e868994de201b2570e4e5854e19420', 
  21             'uploader': 'MarcAshken featuring SOS', 
  25     def _real_extract(self
, url
): 
  26         video_id 
= self
._match
_id
(url
) 
  28         info_data 
= compat_urllib_parse
.urlencode({ 
  32         info 
= self
._download
_json
( 
  33             'http://www.muzu.tv/api/oembed/?%s' % info_data
, 
  34             video_id
, 'Downloading video info') 
  36         player_info 
= self
._download
_json
( 
  37             'http://player.muzu.tv/player/playerInit?ai=%s' % video_id
, 
  38             video_id
, 'Downloading player info') 
  39         video_info 
= player_info
['videos'][0] 
  40         for quality 
in ['1080', '720', '480', '360']: 
  41             if video_info
.get('v%s' % quality
): 
  44         data 
= compat_urllib_parse
.urlencode({ 
  46             # Even if each time you watch a video the hash changes, 
  47             # it seems to work for different videos, and it will work 
  48             # even if you use any non empty string as a hash 
  49             'viewhash': 'VBNff6djeV4HV5TRPW5kOHub2k', 
  53         video_url_info 
= self
._download
_json
( 
  54             'http://player.muzu.tv/player/requestVideo?%s' % data
, 
  55             video_id
, 'Downloading video url') 
  56         video_url 
= video_url_info
['url'] 
  60             'title': info
['title'], 
  62             'thumbnail': info
['thumbnail_url'], 
  63             'description': info
['description'], 
  64             'uploader': info
['author_name'],