From 35c83c26dc305cc2c8efae12209458ac12cd6236 Mon Sep 17 00:00:00 2001 From: Randalix Date: Wed, 13 Aug 2025 00:08:12 +0200 Subject: [PATCH] fix: Correct traverse_obj call in SouthParkDeIE --- yt_dlp/extractor/southpark.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/yt_dlp/extractor/southpark.py b/yt_dlp/extractor/southpark.py index cfcfa3e682..db9f5d8f6f 100644 --- a/yt_dlp/extractor/southpark.py +++ b/yt_dlp/extractor/southpark.py @@ -111,14 +111,13 @@ def _real_extract(self, url): data = self._parse_json(self._search_regex( r'window\.__DATA__\s*=\s*({.+?});', webpage, 'data'), display_id) - # Try multiple paths to find the video data, handling both regular and special episodes - video_detail = traverse_obj(data, [ - # Path for regular episodes (more complex) + # CORRECTED: Provide paths as separate arguments, not a list + video_detail = traverse_obj(data, + # Path for regular episodes ('children', lambda _, v: v.get('type') == 'MainContainer', 'children', 0, 'children', 0, 'props', 'videoDetail'), - # Fallback path for special episodes (simpler) - ('children', 0, 'videoDetail'), - ]) + # Fallback path for special episodes + ('children', 0, 'videoDetail')) if not video_detail: raise ExtractorError('Could not find video data in page')