-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
1 changed files with 4 additions and 2 deletions

View File

@ -698,8 +698,10 @@ public class YoutubeStreamExtractor extends StreamExtractor {
}
String playerCode = downloader.download(playerUrl);
decryptionFuncName =
Parser.matchGroup("([\"\\'])signature\\1\\s*,\\s*([a-zA-Z0-9$]+)\\(", playerCode, 2);
decryptionFuncName = Parser.matchGroup(
// 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 = "("
+ decryptionFuncName.replace("$", "\\$")