Skip to content

Commit 2b70b5f

Browse files
committed
Improve new regex to account for more context
1 parent ca9f193 commit 2b70b5f

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

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

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,16 @@ final class YoutubeThrottlingParameterUtils {
5858
* The third regex matches the following text, where we want SDa and the array index
5959
* accessed:
6060
*
61-
* WL(a),c=a.j[b]||null)&&(c=SDa[0](c)
61+
* ,Vb(m),W=m.j[c]||null)&&(W=cvb[0](W),m.set(c,W)
6262
*/
63-
Pattern.compile(MULTIPLE_CHARS_REGEX + "\\("
63+
Pattern.compile("," + MULTIPLE_CHARS_REGEX + "\\("
6464
+ MULTIPLE_CHARS_REGEX + "\\)," + MULTIPLE_CHARS_REGEX + "="
6565
+ MULTIPLE_CHARS_REGEX + "\\." + MULTIPLE_CHARS_REGEX + "\\["
66-
+ MULTIPLE_CHARS_REGEX + "]\\|\\|null\\)&&\\(" + MULTIPLE_CHARS_REGEX + "=("
67-
+ MULTIPLE_CHARS_REGEX + ")" + ARRAY_ACCESS_REGEX
68-
+ "\\(" + MULTIPLE_CHARS_REGEX + "\\)"),
66+
+ MULTIPLE_CHARS_REGEX + "]\\|\\|null\\)&&\\(\\b" + MULTIPLE_CHARS_REGEX + "=("
67+
+ MULTIPLE_CHARS_REGEX + ")" + ARRAY_ACCESS_REGEX + "\\("
68+
+ SINGLE_CHAR_VARIABLE_REGEX + "\\)," + MULTIPLE_CHARS_REGEX
69+
+ "\\.set\\((?:\"n+\"|" + MULTIPLE_CHARS_REGEX + ")," + MULTIPLE_CHARS_REGEX
70+
+ "\\)"),
6971

7072
/*
7173
* The fourth regex matches the following text, where we want rma:

0 commit comments

Comments
 (0)