From 2b70b5f737536ecac27488e233ade4d8d851e0f8 Mon Sep 17 00:00:00 2001 From: Stypox Date: Sun, 26 Jan 2025 12:55:07 +0100 Subject: [PATCH] Improve new regex to account for more context --- .../youtube/YoutubeThrottlingParameterUtils.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeThrottlingParameterUtils.java b/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeThrottlingParameterUtils.java index fea444cdb..621447469 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeThrottlingParameterUtils.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeThrottlingParameterUtils.java @@ -58,14 +58,16 @@ final class YoutubeThrottlingParameterUtils { * The third regex matches the following text, where we want SDa and the array index * accessed: * - * WL(a),c=a.j[b]||null)&&(c=SDa[0](c) + * ,Vb(m),W=m.j[c]||null)&&(W=cvb[0](W),m.set(c,W) */ - Pattern.compile(MULTIPLE_CHARS_REGEX + "\\(" + Pattern.compile("," + MULTIPLE_CHARS_REGEX + "\\(" + MULTIPLE_CHARS_REGEX + "\\)," + MULTIPLE_CHARS_REGEX + "=" + MULTIPLE_CHARS_REGEX + "\\." + MULTIPLE_CHARS_REGEX + "\\[" - + MULTIPLE_CHARS_REGEX + "]\\|\\|null\\)&&\\(" + MULTIPLE_CHARS_REGEX + "=(" - + MULTIPLE_CHARS_REGEX + ")" + ARRAY_ACCESS_REGEX - + "\\(" + MULTIPLE_CHARS_REGEX + "\\)"), + + MULTIPLE_CHARS_REGEX + "]\\|\\|null\\)&&\\(\\b" + MULTIPLE_CHARS_REGEX + "=(" + + MULTIPLE_CHARS_REGEX + ")" + ARRAY_ACCESS_REGEX + "\\(" + + SINGLE_CHAR_VARIABLE_REGEX + "\\)," + MULTIPLE_CHARS_REGEX + + "\\.set\\((?:\"n+\"|" + MULTIPLE_CHARS_REGEX + ")," + MULTIPLE_CHARS_REGEX + + "\\)"), /* * The fourth regex matches the following text, where we want rma: