From 59979a0680412e164662d884c0c4cad2a715b4ea Mon Sep 17 00:00:00 2001 From: R0hanW <30849420+R0hanW@users.noreply.github.com> Date: Mon, 5 May 2025 15:46:12 -0400 Subject: [PATCH] Use traverse_obj to unpack json data Co-authored-by: bashonly <88596187+bashonly@users.noreply.github.com> --- yt_dlp/extractor/playerfm.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/yt_dlp/extractor/playerfm.py b/yt_dlp/extractor/playerfm.py index 1cf95152e..9b0bcde58 100644 --- a/yt_dlp/extractor/playerfm.py +++ b/yt_dlp/extractor/playerfm.py @@ -50,10 +50,11 @@ def _real_extract(self, url): 'id': video_id, 'url': 'https://' + self._search_regex(r'redirect\.mp3/(.+)', data['url'], 'video url'), 'vcodec': 'none', - 'thumbnail': thumbnail, - 'title': title, - 'creators': creators, - 'description': description, - 'duration': duration, - 'formats': formats, + **traverse_obj(data, { + 'title': ('title', {str}), + 'description': ('description', {clean_html}), + 'duration': ('duration', {int_or_none}), + 'thumbnail': (('image', ('series', 'image')), 'url', {url_or_none}, any), + 'creators': ('series', 'author', {str}, filter, all, filter), + }), }