diff options
author | bashonly <bashonly@bashonly.com> | 2023-09-21 16:54:57 -0500 |
---|---|---|
committer | bashonly <bashonly@bashonly.com> | 2023-09-21 16:54:57 -0500 |
commit | 904a19ee93195ce0bd4b08bd22b186120afb5b17 (patch) | |
tree | c204785ab9863a02f6220b4e8203b89bbe9b27d8 | |
parent | 52414d64ca7b92d3f83964cdd68247989b0c4625 (diff) |
[ie] Make `_search_nuxt_data` more lenient
Authored by: std-move
Co-authored-by: std-move <26625259+std-move@users.noreply.github.com>
-rw-r--r-- | yt_dlp/extractor/common.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/yt_dlp/extractor/common.py b/yt_dlp/extractor/common.py index 7deab995c..c94b4abdc 100644 --- a/yt_dlp/extractor/common.py +++ b/yt_dlp/extractor/common.py @@ -1687,7 +1687,7 @@ class InfoExtractor: def _search_nuxt_data(self, webpage, video_id, context_name='__NUXT__', *, fatal=True, traverse=('data', 0)): """Parses Nuxt.js metadata. This works as long as the function __NUXT__ invokes is a pure function""" rectx = re.escape(context_name) - FUNCTION_RE = r'\(function\((?P<arg_keys>.*?)\){return\s+(?P<js>{.*?})\s*;?\s*}\((?P<arg_vals>.*?)\)' + 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'), |