From 8067c43837b61e52878caa030c249deed45c48f4 Mon Sep 17 00:00:00 2001 From: AudricV <74829229+AudricV@users.noreply.github.com> Date: Sat, 24 Sep 2022 21:49:22 +0200 Subject: [PATCH] [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. --- .../services/youtube/YoutubeThrottlingDecrypter.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeThrottlingDecrypter.java b/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeThrottlingDecrypter.java index f87a07c9a4..1f135bde7d 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeThrottlingDecrypter.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeThrottlingDecrypter.java @@ -38,7 +38,9 @@ public final class YoutubeThrottlingDecrypter { private static final Pattern N_PARAM_PATTERN = Pattern.compile("[&?]n=([^&]+)"); 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 // See https://stackoverflow.com/q/45074813