File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -66,7 +66,19 @@ public YoutubeThrottlingDecrypter() throws ParsingException {
6666
6767 private String parseDecodeFunctionName (final String playerJsCode )
6868 throws Parser .RegexException {
69- return Parser .matchGroup1 (FUNCTION_NAME_PATTERN , playerJsCode );
69+ String functionName = Parser .matchGroup1 (FUNCTION_NAME_PATTERN , playerJsCode );
70+ int arrayStartBrace = functionName .indexOf ("[" );
71+
72+ if (arrayStartBrace > 0 ) {
73+ String arrayVarName = functionName .substring (0 , arrayStartBrace );
74+ String order = functionName .substring (arrayStartBrace +1 , functionName .indexOf ("]" ));
75+ int arrayNum = Integer .parseInt (order );
76+ Pattern ARRAY_PATTERN = Pattern .compile (String .format ("var %s=\\ [(.+?)\\ ];" , arrayVarName ));
77+ String arrayStr = Parser .matchGroup1 (ARRAY_PATTERN , playerJsCode );
78+ String names [] = arrayStr .split ("," );
79+ functionName = names [arrayNum ];
80+ }
81+ return functionName ;
7082 }
7183
7284 @ Nonnull
You can’t perform that action at this time.
0 commit comments