mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-01-10 09:59:53 +00:00
reformat product_detail_json
This commit is contained in:
parent
c588ffdede
commit
7b9f56ade5
|
@ -294,7 +294,9 @@ def _real_extract(self, url):
|
||||||
next_js_data = self._search_nextjs_data(webpage, video_id)['props']
|
next_js_data = self._search_nextjs_data(webpage, video_id)['props']
|
||||||
runtime_info = next_js_data['initialState']['app']['runtimeInfo']
|
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_info = traverse_obj(product_detail_json, ('data', 'current_product'))
|
||||||
current_product_subtitle_info = current_product_info.get('subtitle')
|
current_product_subtitle_info = current_product_info.get('subtitle')
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue