Skip to content

Commit 119843b

Browse files
committed
-Fix signature extraction parse exception.
1 parent 8506709 commit 119843b

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeStreamExtractor.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -698,8 +698,10 @@ private String loadDecryptionCode(String playerUrl) throws DecryptException {
698698
}
699699
String playerCode = downloader.download(playerUrl);
700700

701-
decryptionFuncName =
702-
Parser.matchGroup("([\"\\'])signature\\1\\s*,\\s*([a-zA-Z0-9$]+)\\(", playerCode, 2);
701+
decryptionFuncName = Parser.matchGroup(
702+
// Look for a function with the first line containing pattern of: [var]=[var].split("")
703+
"(\\w+)\\s*=\\s*function\\((\\w+)\\)\\{\\s*\\2=\\s*\\2\\.split\\(\"\"\\)\\s*;",
704+
playerCode, 1);
703705

704706
String functionPattern = "("
705707
+ decryptionFuncName.replace("$", "\\$")

0 commit comments

Comments
 (0)