Fix to handle function call in expression instead of statement
authorJames Bunton <jamesbunton@delx.net.au>
Thu, 15 Dec 2016 19:39:01 +0000 (06:39 +1100)
committerJames Bunton <jamesbunton@delx.net.au>
Thu, 15 Dec 2016 19:39:18 +0000 (06:39 +1100)
youtube.cgi

index 2ad3b70..338fac5 100755 (executable)
@@ -142,7 +142,8 @@ def extract_js(script):
 def find_func_name(script):
     FUNC_NAME = R"([a-zA-Z0-9$]+)"
     FUNC_PARAMS = R"(\([a-zA-Z]+\.s\))"
-    PATTERN = FUNC_NAME + FUNC_PARAMS + ";"
+    TERMINATOR = R"[,;]"
+    PATTERN = FUNC_NAME + FUNC_PARAMS + TERMINATOR
 
     match = re.search(PATTERN, script)
     func_name = match.groups()[0]