[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.
This commit is contained in:
AudricV 2022-09-24 21:49:22 +02:00
parent abcee87167
commit 8067c43837
No known key found for this signature in database
GPG key ID: DA92EC7905614198

View file

@ -38,7 +38,9 @@ public final class YoutubeThrottlingDecrypter {
private static final Pattern N_PARAM_PATTERN = Pattern.compile("[&?]n=([^&]+)"); private static final Pattern N_PARAM_PATTERN = Pattern.compile("[&?]n=([^&]+)");
private static final Pattern DECRYPT_FUNCTION_NAME_PATTERN = Pattern.compile( private static final Pattern DECRYPT_FUNCTION_NAME_PATTERN = Pattern.compile(
"\\.get\\(\"n\"\\)\\)&&\\(b=([a-zA-Z0-9$]+)(?:\\[(\\d+)])?\\([a-zA-Z0-9]\\)"); // CHECKSTYLE:OFF
"\\.get\\(\"n\"\\)\\)&&\\([a-zA-Z0-9$_]=([a-zA-Z0-9$_]+)(?:\\[(\\d+)])?\\([a-zA-Z0-9$_]\\)");
// CHECKSTYLE:ON
// Escape the curly end brace to allow compatibility with Android's regex engine // Escape the curly end brace to allow compatibility with Android's regex engine
// See https://stackoverflow.com/q/45074813 // See https://stackoverflow.com/q/45074813