]>
jfr.im git - yt-dlp.git/blob - yt_dlp/extractor/urort.py
3 from .common
import InfoExtractor
4 from ..utils
import unified_strdate
7 class UrortIE(InfoExtractor
):
8 IE_DESC
= 'NRK P3 Urørt'
9 _VALID_URL
= r
'https?://(?:www\.)?urort\.p3\.no/#!/Band/(?P<id>[^/]+)$'
12 'url': 'https://urort.p3.no/#!/Band/Gerilja',
13 'md5': '5ed31a924be8a05e47812678a86e127b',
18 'thumbnail': r
're:^https?://.+\.jpg',
19 'uploader': 'Gerilja',
20 'uploader_id': 'Gerilja',
21 'upload_date': '20100323',
24 'matchtitle': '^The Bomb$', # To test, we want just one video
28 def _real_extract(self
, url
):
29 playlist_id
= self
._match
_id
(url
)
31 fstr
= urllib
.parse
.quote("InternalBandUrl eq '%s'" % playlist_id
)
32 json_url
= 'http://urort.p3.no/breeze/urort/TrackDTOViews?$filter=%s&$orderby=Released%%20desc&$expand=Tags%%2CFiles' % fstr
33 songs
= self
._download
_json
(json_url
, playlist_id
)
37 'tbr': f
.get('Quality'),
39 'format_id': '%s-%s' % (f
['FileType'], f
.get('Quality', '')),
40 'url': 'http://p3urort.blob.core.windows.net/tracks/%s' % f
['FileRef'],
41 'quality': 3 if f
['FileType'] == 'mp3' else 2,
42 } for f
in s
['Files']]
43 self
._sort
_formats
(formats
)
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/%s' % s
['Image'],
50 'upload_date': unified_strdate(s
.get('Released')),