From b8738e36c65799a2db0ff93566011b0d7aabe634 Mon Sep 17 00:00:00 2001 From: sepro Date: Sun, 6 Apr 2025 17:03:55 +0200 Subject: [PATCH] Apply code suggestion Co-Authored-By: bashonly <88596187+bashonly@users.noreply.github.com> --- yt_dlp/extractor/agora.py | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/yt_dlp/extractor/agora.py b/yt_dlp/extractor/agora.py index 4d07322a50..e040db6010 100644 --- a/yt_dlp/extractor/agora.py +++ b/yt_dlp/extractor/agora.py @@ -164,21 +164,20 @@ class TokFMPodcastIE(InfoExtractor): raise ExtractorError('No such podcast', expected=True) metadata = metadata[0] - formats = [] - url_data = self._download_json( - f'https://api.podcast.radioagora.pl/api4/getSongUrl?podcast_id={media_id}&device_id={uuid.uuid4()}&ppre=false&audio=mp3', - media_id, 'Downloading podcast mp3 URL') - if 'link_ssl' in url_data: - formats.append({ - 'url': url_data['link_ssl'], - 'ext': 'mp3', - 'vcodec': 'none', - 'acodec': 'mp3', - }) + mp3_url = self._download_json( + 'https://api.podcast.radioagora.pl/api4/getSongUrl', + media_id, 'Downloading podcast mp3 URL', query={ + 'podcast_id': media_id, + 'device_id': str(uuid.uuid4()), + 'ppre': 'false', + 'audio': 'mp3', + })['link_ssl'] return { 'id': media_id, - 'formats': formats, + 'url': mp3_url, + 'vcodec': 'none', + 'ext': 'mp3', 'title': metadata.get('podcast_name'), 'series': metadata.get('series_name'), 'episode': metadata.get('podcast_name'),