2 from __future__ import unicode_literals
4 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': r're:^https?://.+\.jpg',
25 'uploader': 'Gerilja',
26 'uploader_id': 'Gerilja',
27 'upload_date': '20100323',
30 'matchtitle': '^The Bomb$', # To test, we want just one video
34 def _real_extract(self, url):
35 playlist_id = self._match_id(url)
37 fstr = compat_urllib_parse.quote("InternalBandUrl eq '%s'" % playlist_id)
38 json_url = 'http://urort.p3.no/breeze/urort/TrackDTOViews?$filter=%s&$orderby=Released%%20desc&$expand=Tags%%2CFiles' % fstr
39 songs = self._download_json(json_url, playlist_id)
43 'tbr': f.get('Quality'),
45 'format_id': '%s-%s' % (f['FileType'], f.get('Quality', '')),
46 'url': 'http://p3urort.blob.core.windows.net/tracks/%s' % f['FileRef'],
47 'preference': 3 if f['FileType'] == 'mp3' else 2,
48 } for f in s['Files']]
49 self._sort_formats(formats)
51 'id': '%d-%s' % (s['BandId'], s['$id']),
53 'uploader_id': playlist_id,
54 'uploader': s.get('BandName', playlist_id),
55 'thumbnail': 'http://urort.p3.no/cloud/images/%s' % s['Image'],
56 'upload_date': unified_strdate(s.get('Released')),