mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-04-29 10:16:39 +02:00
[ie/TokFMPodcast] Fix formats extraction (#12842)
Authored by: selfisekai
This commit is contained in:
parent
425017531f
commit
91832111a1
1 changed files with 12 additions and 15 deletions
|
@ -146,7 +146,7 @@ class TokFMPodcastIE(InfoExtractor):
|
||||||
'url': 'https://audycje.tokfm.pl/podcast/91275,-Systemowy-rasizm-Czy-zamieszki-w-USA-po-morderstwie-w-Minneapolis-doprowadza-do-zmian-w-sluzbach-panstwowych',
|
'url': 'https://audycje.tokfm.pl/podcast/91275,-Systemowy-rasizm-Czy-zamieszki-w-USA-po-morderstwie-w-Minneapolis-doprowadza-do-zmian-w-sluzbach-panstwowych',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
'id': '91275',
|
'id': '91275',
|
||||||
'ext': 'aac',
|
'ext': 'mp3',
|
||||||
'title': 'md5:a9b15488009065556900169fb8061cce',
|
'title': 'md5:a9b15488009065556900169fb8061cce',
|
||||||
'episode': 'md5:a9b15488009065556900169fb8061cce',
|
'episode': 'md5:a9b15488009065556900169fb8061cce',
|
||||||
'series': 'Analizy',
|
'series': 'Analizy',
|
||||||
|
@ -164,23 +164,20 @@ class TokFMPodcastIE(InfoExtractor):
|
||||||
raise ExtractorError('No such podcast', expected=True)
|
raise ExtractorError('No such podcast', expected=True)
|
||||||
metadata = metadata[0]
|
metadata = metadata[0]
|
||||||
|
|
||||||
formats = []
|
mp3_url = self._download_json(
|
||||||
for ext in ('aac', 'mp3'):
|
'https://api.podcast.radioagora.pl/api4/getSongUrl',
|
||||||
url_data = self._download_json(
|
media_id, 'Downloading podcast mp3 URL', query={
|
||||||
f'https://api.podcast.radioagora.pl/api4/getSongUrl?podcast_id={media_id}&device_id={uuid.uuid4()}&ppre=false&audio={ext}',
|
'podcast_id': media_id,
|
||||||
media_id, f'Downloading podcast {ext} URL')
|
'device_id': str(uuid.uuid4()),
|
||||||
# prevents inserting the mp3 (default) multiple times
|
'ppre': 'false',
|
||||||
if 'link_ssl' in url_data and f'.{ext}' in url_data['link_ssl']:
|
'audio': 'mp3',
|
||||||
formats.append({
|
})['link_ssl']
|
||||||
'url': url_data['link_ssl'],
|
|
||||||
'ext': ext,
|
|
||||||
'vcodec': 'none',
|
|
||||||
'acodec': ext,
|
|
||||||
})
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'id': media_id,
|
'id': media_id,
|
||||||
'formats': formats,
|
'url': mp3_url,
|
||||||
|
'vcodec': 'none',
|
||||||
|
'ext': 'mp3',
|
||||||
'title': metadata.get('podcast_name'),
|
'title': metadata.get('podcast_name'),
|
||||||
'series': metadata.get('series_name'),
|
'series': metadata.get('series_name'),
|
||||||
'episode': metadata.get('podcast_name'),
|
'episode': metadata.get('podcast_name'),
|
||||||
|
|
Loading…
Add table
Reference in a new issue