From 7b9f56ade5aefbed689a503112eda9e5fa2b0566 Mon Sep 17 00:00:00 2001 From: HobbyistDev Date: Wed, 21 Feb 2024 18:39:21 +0800 Subject: [PATCH] reformat `product_detail_json` --- yt_dlp/extractor/viu.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/yt_dlp/extractor/viu.py b/yt_dlp/extractor/viu.py index 95fd14359e..ea75a93623 100644 --- a/yt_dlp/extractor/viu.py +++ b/yt_dlp/extractor/viu.py @@ -294,7 +294,9 @@ def _real_extract(self, url): next_js_data = self._search_nextjs_data(webpage, video_id)['props'] runtime_info = next_js_data['initialState']['app']['runtimeInfo'] - product_detail_json = traverse_obj(next_js_data, ('pageProps', 'fallback', lambda k, v: v if re.match(r'@"PRODUCT_DETAIL"[^:]+', k) else None), get_all=False) + product_detail_json = traverse_obj( + 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')