Skip to content

Commit 8067c43

Browse files
committed
[YouTube] Don't use a specific letter for the decryption function name pattern
Use the same possible characters for variables everywhere, in order to avoid potential future throttling parameter decryption function name parsing issues related to the usage of other letter(s) than b.
1 parent abcee87 commit 8067c43

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeThrottlingDecrypter.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ public final class YoutubeThrottlingDecrypter {
3838

3939
private static final Pattern N_PARAM_PATTERN = Pattern.compile("[&?]n=([^&]+)");
4040
private static final Pattern DECRYPT_FUNCTION_NAME_PATTERN = Pattern.compile(
41-
"\\.get\\(\"n\"\\)\\)&&\\(b=([a-zA-Z0-9$]+)(?:\\[(\\d+)])?\\([a-zA-Z0-9]\\)");
41+
// CHECKSTYLE:OFF
42+
"\\.get\\(\"n\"\\)\\)&&\\([a-zA-Z0-9$_]=([a-zA-Z0-9$_]+)(?:\\[(\\d+)])?\\([a-zA-Z0-9$_]\\)");
43+
// CHECKSTYLE:ON
4244

4345
// Escape the curly end brace to allow compatibility with Android's regex engine
4446
// See https://stackoverflow.com/q/45074813

0 commit comments

Comments
 (0)