X-Git-Url: https://jfr.im/git/yt-dlp.git/blobdiff_plain/b4a252fba81f53631c07ca40ce7583f5d19a8a36..c4b87dd885ee5391e5f481e7c8bd550a7c543623:/yt_dlp/jsinterp.py diff --git a/yt_dlp/jsinterp.py b/yt_dlp/jsinterp.py index d6d555733..bda3fb459 100644 --- a/yt_dlp/jsinterp.py +++ b/yt_dlp/jsinterp.py @@ -779,7 +779,7 @@ def extract_object(self, objname): obj = {} obj_m = re.search( r'''(?x) - (?(%s\s*:\s*function\s*\(.*?\)\s*{.*?}(?:,\s*)?)*) }\s*; ''' % (re.escape(objname), _FUNC_NAME_RE), @@ -812,9 +812,9 @@ def extract_function_code(self, funcname): \((?P[^)]*)\)\s* (?P{.+})''' % {'name': re.escape(funcname)}, self.code) - code, _ = self._separate_at_paren(func_m.group('code')) if func_m is None: raise self.Exception(f'Could not find JS function "{funcname}"') + code, _ = self._separate_at_paren(func_m.group('code')) return [x.strip() for x in func_m.group('args').split(',')], code def extract_function(self, funcname):