From fc040bfd058202b0b8c9f69b12e3a2d32e8f380c Mon Sep 17 00:00:00 2001 From: Philipp Hagemeister Date: Fri, 11 Jul 2014 10:44:56 +0200 Subject: [PATCH] [jsinterp] Prevent mis-recognitions of local functions --- youtube_dl/jsinterp.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/youtube_dl/jsinterp.py b/youtube_dl/jsinterp.py index d7e76713f..3bbb07704 100644 --- a/youtube_dl/jsinterp.py +++ b/youtube_dl/jsinterp.py @@ -99,7 +99,7 @@ class JSInterpreter(object): def extract_function(self, funcname): func_m = re.search( - (r'(?:function %s|%s\s*=\s*function)' % ( + (r'(?:function %s|[{;]%s\s*=\s*function)' % ( re.escape(funcname), re.escape(funcname))) + r'\((?P[a-z,]+)\){(?P[^}]+)}', self.code)