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