]> jfr.im git - yt-dlp.git/blob - yt_dlp/extractor/rinsefm.py
760adf0ebae3c12a26aa4b414595a1302d3a49c2
[yt-dlp.git] / yt_dlp / extractor / rinsefm.py
1 from .common import InfoExtractor
2 from ..utils import format_field, parse_iso8601
3
4
5 class RinseFMIE(InfoExtractor):
6 _VALID_URL = r'https?://(?:www\.)?rinse\.fm/episodes/(?P<id>[^/?#]+)'
7 _TESTS = [{
8 'url': 'https://rinse.fm/episodes/club-glow-15-12-2023-2000/',
9 'md5': '76ee0b719315617df42e15e710f46c7b',
10 'info_dict': {
11 'id': '1536535',
12 'ext': 'mp3',
13 'title': 'Club Glow - 15/12/2023 - 20:00',
14 'thumbnail': r're:^https://.+\.(?:jpg|JPG)$',
15 'release_timestamp': 1702598400,
16 'release_date': '20231215'
17 }
18 }]
19
20 def _real_extract(self, url):
21 display_id = self._match_id(url)
22 webpage = self._download_webpage(url, display_id)
23 entry = self._search_nextjs_data(webpage, display_id)['props']['pageProps']['entry']
24
25 return {
26 'id': entry['id'],
27 'title': entry.get('title'),
28 'url': entry['fileUrl'],
29 'vcodec': 'none',
30 'release_timestamp': parse_iso8601(entry.get('episodeDate')),
31 'thumbnail': format_field(
32 entry, [('featuredImage', 0, 'filename')], 'https://rinse.imgix.net/media/%s', default=None),
33 }