]>
jfr.im git - yt-dlp.git/blob - yt_dlp/extractor/rbmaradio.py
1 from .common
import InfoExtractor
2 from ..compat
import compat_str
11 class RBMARadioIE(InfoExtractor
):
12 _VALID_URL
= r
'https?://(?:www\.)?(?:rbmaradio|redbullradio)\.com/shows/(?P<show_id>[^/]+)/episodes/(?P<id>[^/?#&]+)'
14 'url': 'https://www.rbmaradio.com/shows/main-stage/episodes/ford-lopatin-live-at-primavera-sound-2011',
15 'md5': '6bc6f9bcb18994b4c983bc3bf4384d95',
17 'id': 'ford-lopatin-live-at-primavera-sound-2011',
19 'title': 'Main Stage - Ford & Lopatin at Primavera Sound',
20 'description': 'md5:d41d8cd98f00b204e9800998ecf8427e',
21 'thumbnail': r
're:^https?://.*\.jpg',
23 'timestamp': 1307103164,
24 'upload_date': '20110603',
28 def _real_extract(self
, url
):
29 mobj
= self
._match
_valid
_url
(url
)
30 show_id
= mobj
.group('show_id')
31 episode_id
= mobj
.group('id')
33 webpage
= self
._download
_webpage
(url
, episode_id
)
35 episode
= self
._parse
_json
(
37 r
'__INITIAL_STATE__\s*=\s*({.+?})\s*</script>',
38 webpage
, 'json data'),
39 episode_id
)['episodes'][show_id
][episode_id
]
41 title
= episode
['title']
43 show_title
= episode
.get('showTitle')
45 title
= '%s - %s' % (show_title
, title
)
48 'url': update_url_query(episode
['audioURL'], query
={'cbr': abr}
),
49 'format_id': compat_str(abr
),
52 } for abr
in (96, 128, 192, 256)]
53 self
._check
_formats
(formats
, episode_id
)
55 description
= clean_html(episode
.get('longTeaser'))
56 thumbnail
= self
._proto
_relative
_url
(episode
.get('imageURL', {}).get('landscape'))
57 duration
= int_or_none(episode
.get('duration'))
58 timestamp
= unified_timestamp(episode
.get('publishedAt'))
63 'description': description
,
64 'thumbnail': thumbnail
,
66 'timestamp': timestamp
,