0
0
Fork 0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2024-11-30 03:33:02 +00:00

[jsinterp] Relax JS function regex (Closes #9863)

This commit is contained in:
Sergey M․ 2016-06-23 09:41:34 +07:00
parent 0437307a41
commit b46eabecd3
No known key found for this signature in database
GPG key ID: 2C393E0F18A9236D

View file

@ -232,7 +232,7 @@ def extract_object(self, objname):
def extract_function(self, funcname): def extract_function(self, funcname):
func_m = re.search( func_m = re.search(
r'''(?x) r'''(?x)
(?:function\s+%s|[{;,]%s\s*=\s*function|var\s+%s\s*=\s*function)\s* (?:function\s+%s|[{;,]\s*%s\s*=\s*function|var\s+%s\s*=\s*function)\s*
\((?P<args>[^)]*)\)\s* \((?P<args>[^)]*)\)\s*
\{(?P<code>[^}]+)\}''' % ( \{(?P<code>[^}]+)\}''' % (
re.escape(funcname), re.escape(funcname), re.escape(funcname)), re.escape(funcname), re.escape(funcname), re.escape(funcname)),