about summary refs log tree commit diff
diff options
context:
space:
mode:
authordirkf <fieldhouse@gmx.net>2023-06-17 15:34:11 +0100
committerdirkf <fieldhouse@gmx.net>2023-06-17 15:34:11 +0100
commitff75c300f52321dc7322e28d1df153cf0ea65a6d (patch)
treed6d5d6b8e3e05f198c4e2ce96eadf1b59d40ce1b
parenta2534f7b888416e872d5afd1862eb3e30fc69fc7 (diff)
downloadyoutube-dl-ff75c300f52321dc7322e28d1df153cf0ea65a6d.tar.gz
youtube-dl-ff75c300f52321dc7322e28d1df153cf0ea65a6d.tar.xz
youtube-dl-ff75c300f52321dc7322e28d1df153cf0ea65a6d.zip
[jsinterp] Fix test for failed match in extract_object()
-rw-r--r--youtube_dl/jsinterp.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/youtube_dl/jsinterp.py b/youtube_dl/jsinterp.py
index 9d4a5bc57..c18c4fef1 100644
--- a/youtube_dl/jsinterp.py
+++ b/youtube_dl/jsinterp.py
@@ -985,9 +985,9 @@ class JSInterpreter(object):
                 \((?P<args>[^)]*)\)\s*
                 (?P<code>{.+})''' % {'name': re.escape(funcname)},
             self.code)
-        code, _ = self._separate_at_paren(func_m.group('code'))  # refine the match
         if func_m is None:
             raise self.Exception('Could not find JS function "{funcname}"'.format(**locals()))
+        code, _ = self._separate_at_paren(func_m.group('code'))  # refine the match
         return self.build_arglist(func_m.group('args')), code
 
     def extract_function(self, funcname):