]> jfr.im git - yt-dlp.git/blobdiff - yt_dlp/jsinterp.py
Update to ytdl-commit-07af47
[yt-dlp.git] / yt_dlp / jsinterp.py
index 9c280fb86f839d2ce72efece3167d1e2e306e8f7..bda3fb45991e6a06683bddf38676629a154141d0 100644 (file)
@@ -812,9 +812,9 @@ def extract_function_code(self, funcname):
                 \((?P<args>[^)]*)\)\s*
                 (?P<code>{.+})''' % {'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):