1 from .common
import InfoExtractor
4 class RadioDeIE(InfoExtractor
):
7 _VALID_URL
= r
'https?://(?P<id>.+?)\.(?:radio\.(?:de|at|fr|pt|es|pl|it)|rad\.io)'
9 'url': 'http://ndr2.radio.de/',
13 'title': 're:^NDR 2 [0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}$',
14 'description': 'md5:591c49c702db1a33751625ebfb67f273',
15 'thumbnail': r
're:^https?://.*\.png',
19 'skip_download': True,
23 def _real_extract(self
, url
):
24 radio_id
= self
._match
_id
(url
)
25 webpage
= self
._download
_webpage
(url
, radio_id
)
26 jscode
= self
._search
_regex
(
27 r
"'components/station/stationService':\s*\{\s*'?station'?:\s*(\{.*?\s*\}),\n",
30 broadcast
= self
._parse
_json
(jscode
, radio_id
)
31 title
= broadcast
['name']
32 description
= broadcast
.get('description') or broadcast
.get('shortDescription')
33 thumbnail
= broadcast
.get('picture4Url') or broadcast
.get('picture4TransUrl') or broadcast
.get('logo100x100')
36 'url': stream
['streamUrl'],
37 'ext': stream
['streamContentFormat'].lower(),
38 'acodec': stream
['streamContentFormat'],
39 'abr': stream
['bitRate'],
40 'asr': stream
['sampleRate'],
41 } for stream
in broadcast
['streamUrls']]
46 'description': description
,
47 'thumbnail': thumbnail
,