From 3f7d3d20bd17f84a36ceff2e44d48b2eb32168dd Mon Sep 17 00:00:00 2001 From: HobbyistDev Date: Fri, 1 Mar 2024 13:24:37 +0800 Subject: [PATCH] delete single use variable `current_product_subtitle_info` --- yt_dlp/extractor/viu.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/yt_dlp/extractor/viu.py b/yt_dlp/extractor/viu.py index 41fa9b52f9..1ef55bcfb2 100644 --- a/yt_dlp/extractor/viu.py +++ b/yt_dlp/extractor/viu.py @@ -301,11 +301,10 @@ def _real_extract(self, url): next_js_data, ('pageProps', 'fallback', lambda k, v: v if re.match(r'@"PRODUCT_DETAIL"[^:]+', k) else None), get_all=False) current_product_info = traverse_obj(product_detail_json, ('data', 'current_product')) - current_product_subtitle_info = current_product_info.get('subtitle') formats, subtitles = [], {} - for subtitle_info in current_product_subtitle_info: + for subtitle_info in current_product_info.get('subtitle') or []: subtitles.setdefault(subtitle_info.get('code'), []).append({ 'url': subtitle_info.get('url'), 'name': subtitle_info.get('name')