File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change 37
37
public final class YoutubeThrottlingDecrypter {
38
38
39
39
private static final Pattern N_PARAM_PATTERN = Pattern .compile ("[&?]n=([^&]+)" );
40
+ private static final String SINGLE_CHAR_VARIABLE_REGEX = "[a-zA-Z0-9$_]" ;
41
+
42
+ private static final String FUNCTION_NAME_REGEX = SINGLE_CHAR_VARIABLE_REGEX + "+" ;
43
+
44
+ private static final String ARRAY_ACCESS_REGEX = "\\ [(\\ d+)]" ;
40
45
private static final Pattern DECRYPT_FUNCTION_NAME_PATTERN = Pattern .compile (
41
46
// CHECKSTYLE:OFF
42
- "\\ .get\\ (\" n\" \\ )\\ )&&\\ ([a-zA-Z0-9$_]=([a-zA-Z0-9$_]+)(?:\\ [(\\ d+)])?\\ ([a-zA-Z0-9$_]\\ )" );
47
+ "\\ (" + SINGLE_CHAR_VARIABLE_REGEX + "=String\\ .fromCharCode\\ (110\\ ),"
48
+ + SINGLE_CHAR_VARIABLE_REGEX + "=" + SINGLE_CHAR_VARIABLE_REGEX + "\\ .get\\ ("
49
+ + SINGLE_CHAR_VARIABLE_REGEX + "\\ )\\ )" + "&&\\ (" + SINGLE_CHAR_VARIABLE_REGEX
50
+ + "=(" + FUNCTION_NAME_REGEX + ")" + "(?:" + ARRAY_ACCESS_REGEX + ")?\\ ("
51
+ + SINGLE_CHAR_VARIABLE_REGEX + "\\ )" );
43
52
// CHECKSTYLE:ON
44
53
45
54
// Escape the curly end brace to allow compatibility with Android's regex engine
You can’t perform that action at this time.
0 commit comments