-Fix signature extraction parse exception.

This commit is contained in:
John Zhen Mo 2018-09-07 11:34:14 -07:00
parent 850670917f
commit 119843bfac

View file

@ -698,8 +698,10 @@ public class YoutubeStreamExtractor extends StreamExtractor {
} }
String playerCode = downloader.download(playerUrl); String playerCode = downloader.download(playerUrl);
decryptionFuncName = decryptionFuncName = Parser.matchGroup(
Parser.matchGroup("([\"\\'])signature\\1\\s*,\\s*([a-zA-Z0-9$]+)\\(", playerCode, 2); // Look for a function with the first line containing pattern of: [var]=[var].split("")
"(\\w+)\\s*=\\s*function\\((\\w+)\\)\\{\\s*\\2=\\s*\\2\\.split\\(\"\"\\)\\s*;",
playerCode, 1);
String functionPattern = "(" String functionPattern = "("
+ decryptionFuncName.replace("$", "\\$") + decryptionFuncName.replace("$", "\\$")