From: Philipp Hagemeister Date: Fri, 11 Jul 2014 08:44:56 +0000 (+0200) Subject: [jsinterp] Prevent mis-recognitions of local functions X-Git-Url: http://git.oshgnacknak.de/?a=commitdiff_plain;h=fc040bfd058202b0b8c9f69b12e3a2d32e8f380c;p=youtube-dl [jsinterp] Prevent mis-recognitions of local functions --- 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)