aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpukkandan <pukkandan.ytdlp@gmail.com>2022-11-11 03:39:41 +0530
committerpukkandan <pukkandan.ytdlp@gmail.com>2022-11-11 07:29:29 +0530
commitf7fc8d39e99d5b0683ac48a876618a5495a9ef5e (patch)
treed59ee577ca15601da99c99d1ad8efb89e88ee024
parenta6858cda296b532db3fd7bcfc4f960f9b2fdf30a (diff)
downloadhypervideo-pre-f7fc8d39e99d5b0683ac48a876618a5495a9ef5e.tar.lz
hypervideo-pre-f7fc8d39e99d5b0683ac48a876618a5495a9ef5e.tar.xz
hypervideo-pre-f7fc8d39e99d5b0683ac48a876618a5495a9ef5e.zip
[extractor] Fix `fatal=False` for `_search_nuxt_data`
Closes #5423
-rw-r--r--yt_dlp/extractor/common.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/yt_dlp/extractor/common.py b/yt_dlp/extractor/common.py
index 34650cf4e..570f8195c 100644
--- a/yt_dlp/extractor/common.py
+++ b/yt_dlp/extractor/common.py
@@ -1647,7 +1647,10 @@ class InfoExtractor:
FUNCTION_RE = r'\(function\((?P<arg_keys>.*?)\){return\s+(?P<js>{.*?})\s*;?\s*}\((?P<arg_vals>.*?)\)'
js, arg_keys, arg_vals = self._search_regex(
(rf'<script>\s*window\.{rectx}={FUNCTION_RE}\s*\)\s*;?\s*</script>', rf'{rectx}\(.*?{FUNCTION_RE}'),
- webpage, context_name, group=('js', 'arg_keys', 'arg_vals'), fatal=fatal)
+ webpage, context_name, group=('js', 'arg_keys', 'arg_vals'),
+ default=NO_DEFAULT if fatal else (None, None, None))
+ if js is None:
+ return {}
args = dict(zip(arg_keys.split(','), arg_vals.split(',')))