]>
jfr.im git - yt-dlp.git/blob - yt_dlp/extractor/rtrfm.py
1 from __future__
import unicode_literals
3 from .common
import InfoExtractor
6 class RTRFMIE(InfoExtractor
):
7 _VALID_URL
= r
'https?://(?:www\.)?rtrfm\.com\.au/(?:shows|show-episode)/(?P<id>[^/?\#&]+)'
10 'url': 'https://rtrfm.com.au/shows/breakfast/',
11 'md5': '46168394d3a5ce237cf47e85d0745413',
13 'id': 'breakfast-2021-11-16',
15 'series': 'Breakfast with Taylah',
16 'title': r
're:^Breakfast with Taylah \d{4}-\d{2}-\d{2}$',
17 'description': 'md5:0979c3ab1febfbec3f1ccb743633c611',
19 'skip': 'ID and md5 changes daily',
22 'url': 'https://rtrfm.com.au/show-episode/breakfast-2021-11-11/',
23 'md5': '396bedf1e40f96c62b30d4999202a790',
25 'id': 'breakfast-2021-11-11',
27 'series': 'Breakfast with Taylah',
28 'title': 'Breakfast with Taylah 2021-11-11',
29 'description': 'md5:0979c3ab1febfbec3f1ccb743633c611',
33 'url': 'https://rtrfm.com.au/show-episode/breakfast-2020-06-01/',
34 'md5': '594027f513ec36a24b15d65007a24dff',
36 'id': 'breakfast-2020-06-01',
38 'series': 'Breakfast with Taylah',
39 'title': 'Breakfast with Taylah 2020-06-01',
40 'description': r
're:^Breakfast with Taylah ',
42 'skip': 'This audio has expired',
46 def _real_extract(self
, url
):
47 display_id
= self
._match
_id
(url
)
48 webpage
= self
._download
_webpage
(url
, display_id
)
49 show
, date
, title
= self
._search
_regex
(
50 r
'''\.playShow(?:From)?\(['"](?P<show>[^'"]+)['"],\s*['"](?P<date>[0-9]{4}-[0-9]{2}-[0-9]{2})['"],\s*['"](?P<title>[^'"]+)['"]''',
51 webpage
, 'details', group
=('show', 'date', 'title'))
52 url
= self
._download
_json
(
53 'https://restreams.rtrfm.com.au/rzz',
54 show
, 'Downloading MP3 URL', query
={'n': show, 'd': date}
)['u']
55 # This is the only indicator of an error until trying to download the URL and
56 # downloads of mp4 URLs always fail (403 for current episodes, 404 for missing).
59 self
.raise_no_formats('Expired or no episode on this date', expected
=True)
61 'id': '%s-%s' % (show
, date
),
62 'title': '%s %s' % (title
, date
),
66 'description': self
._og
_search
_description
(webpage
),