]>
jfr.im git - yt-dlp.git/blob - yt_dlp/extractor/urort.py
1 from .common
import InfoExtractor
10 class UrortIE(InfoExtractor
):
11 IE_DESC
= 'NRK P3 Urørt'
12 _VALID_URL
= r
'https?://(?:www\.)?urort\.p3\.no/#!/Band/(?P<id>[^/]+)$'
15 'url': 'https://urort.p3.no/#!/Band/Gerilja',
16 'md5': '5ed31a924be8a05e47812678a86e127b',
21 'thumbnail': r
're:^https?://.+\.jpg',
22 'uploader': 'Gerilja',
23 'uploader_id': 'Gerilja',
24 'upload_date': '20100323',
27 'matchtitle': '^The Bomb$', # To test, we want just one video
31 def _real_extract(self
, url
):
32 playlist_id
= self
._match
_id
(url
)
34 fstr
= compat_urllib_parse
.quote("InternalBandUrl eq '%s'" % playlist_id
)
35 json_url
= 'http://urort.p3.no/breeze/urort/TrackDTOViews?$filter=%s&$orderby=Released%%20desc&$expand=Tags%%2CFiles' % fstr
36 songs
= self
._download
_json
(json_url
, playlist_id
)
40 'tbr': f
.get('Quality'),
42 'format_id': '%s-%s' % (f
['FileType'], f
.get('Quality', '')),
43 'url': 'http://p3urort.blob.core.windows.net/tracks/%s' % f
['FileRef'],
44 'quality': 3 if f
['FileType'] == 'mp3' else 2,
45 } for f
in s
['Files']]
46 self
._sort
_formats
(formats
)
48 'id': '%d-%s' % (s
['BandId'], s
['$id']),
50 'uploader_id': playlist_id
,
51 'uploader': s
.get('BandName', playlist_id
),
52 'thumbnail': 'http://urort.p3.no/cloud/images/%s' % s
['Image'],
53 'upload_date': unified_strdate(s
.get('Released')),