]>
Raphaël G. Git Repositories - youtubedl/blob - youtube_dl/extractor/urort.py
   2 from __future__ 
import unicode_literals
 
   6 from .common 
import InfoExtractor
 
  13 class UrortIE(InfoExtractor
): 
  14     IE_DESC 
= 'NRK P3 Urørt' 
  15     _VALID_URL 
= r
'https?://(?:www\.)?urort\.p3\.no/#!/Band/(?P<id>[^/]+)$' 
  18         'url': 'https://urort.p3.no/#!/Band/Gerilja', 
  19         'md5': '5ed31a924be8a05e47812678a86e127b', 
  24             'thumbnail': 're:^https?://.+\.jpg', 
  26             'uploader': 'Gerilja', 
  27             'uploader_id': 'Gerilja', 
  28             'upload_date': '20100323', 
  31             'matchtitle': '^The Bomb$',  # To test, we want just one video 
  35     def _real_extract(self
, url
): 
  36         mobj 
= re
.match(self
._VALID
_URL
, url
) 
  37         playlist_id 
= mobj
.group('id') 
  39         fstr 
= compat_urllib_parse
.quote("InternalBandUrl eq '%s'" % playlist_id
) 
  40         json_url 
= 'http://urort.p3.no/breeze/urort/TrackDtos?$filter=' + fstr
 
  41         songs 
= self
._download
_json
(json_url
, playlist_id
) 
  45             'id': '%d-%s' % (s
['BandId'], s
['$id']), 
  49             'uploader_id': playlist_id
, 
  50             'uploader': s
.get('BandName', playlist_id
), 
  51             'like_count': s
.get('LikeCount'), 
  52             'thumbnail': 'http://urort.p3.no/cloud/images/%s' % s
['Image'], 
  53             'upload_date': unified_strdate(s
.get('Released')),