3 from .common
import InfoExtractor
4 from ..utils
import unified_strdate
7 class UrortIE(InfoExtractor
):
9 IE_DESC
= 'NRK P3 Urørt'
10 _VALID_URL
= r
'https?://(?:www\.)?urort\.p3\.no/#!/Band/(?P<id>[^/]+)$'
13 'url': 'https://urort.p3.no/#!/Band/Gerilja',
14 'md5': '5ed31a924be8a05e47812678a86e127b',
19 'thumbnail': r
're:^https?://.+\.jpg',
20 'uploader': 'Gerilja',
21 'uploader_id': 'Gerilja',
22 'upload_date': '20100323',
25 'matchtitle': '^The Bomb$', # To test, we want just one video
29 def _real_extract(self
, url
):
30 playlist_id
= self
._match
_id
(url
)
32 fstr
= urllib
.parse
.quote(f
"InternalBandUrl eq '{playlist_id}'")
33 json_url
= f
'http://urort.p3.no/breeze/urort/TrackDTOViews?$filter={fstr}&$orderby=Released%20desc&$expand=Tags%2CFiles'
34 songs
= self
._download
_json
(json_url
, playlist_id
)
38 'tbr': f
.get('Quality'),
40 'format_id': '{}-{}'.format(f
['FileType'], f
.get('Quality', '')),
41 'url': 'http://p3urort.blob.core.windows.net/tracks/{}'.format(f
['FileRef']),
42 'quality': 3 if f
['FileType'] == 'mp3' else 2,
43 } for f
in s
['Files']]
45 'id': '%d-%s' % (s
['BandId'], s
['$id']),
47 'uploader_id': playlist_id
,
48 'uploader': s
.get('BandName', playlist_id
),
49 'thumbnail': 'http://urort.p3.no/cloud/images/{}'.format(s
['Image']),
50 'upload_date': unified_strdate(s
.get('Released')),