diff options
| author | Simon Sawicki <contact@grub4k.xyz> | 2023-10-07 03:02:45 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-10-07 03:02:45 +0200 |
| commit | 377e85a1797db9e98b78b38203ed9d4ded229991 (patch) | |
| tree | 7ac73dbf495fa2f59cf02099a24022e67cc5de21 /yt_dlp/extractor/common.py | |
| parent | 03e85ea99db76a2fddb65bf46f8819bda780aaf3 (diff) | |
[cleanup] Misc (#8300)
* Simplify nuxt regex
* Fix tmz quotes and tests
* Update test python versions
Authored by: dirkf, gamer191, Grub4K
Diffstat (limited to 'yt_dlp/extractor/common.py')
| -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 c94b4abdc..c3ceb0039 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>.*?)\){.*?\breturn\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'), |
