Skip to content

Commit c7d5988

Browse files
gechotoStypox
authored andcommitted
YoutubeThrottlingParameterUtils: swap regex positions again
1 parent 14f7ef1 commit c7d5988

1 file changed

Lines changed: 13 additions & 16 deletions

File tree

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

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,6 @@ final class YoutubeThrottlingParameterUtils {
3333
* The first regex matches the following text, where we want SDa and the array index
3434
* accessed:
3535
*
36-
* WL(a),c=a.j[b]||null)&&(c=SDa[0](
37-
*/
38-
Pattern.compile(MULTIPLE_CHARS_REGEX + "\\("
39-
+ MULTIPLE_CHARS_REGEX + "\\)," + MULTIPLE_CHARS_REGEX + "="
40-
+ MULTIPLE_CHARS_REGEX + "\\." + MULTIPLE_CHARS_REGEX + "\\["
41-
+ MULTIPLE_CHARS_REGEX + "]\\|\\|null\\)&&\\(" + MULTIPLE_CHARS_REGEX + "=("
42-
+ MULTIPLE_CHARS_REGEX + ")" + ARRAY_ACCESS_REGEX + "\\("),
43-
44-
/*
45-
* The second regex matches the following text, where we want SDa and the array index
46-
* accessed:
47-
*
4836
* a.D&&(b="nn"[+a.D],WL(a),c=a.j[b]||null)&&(c=SDa[0](c),a.set(b,c),SDa.length||Wma("")
4937
*/
5038
Pattern.compile(SINGLE_CHAR_VARIABLE_REGEX + "=\"nn\"\\[\\+" + MULTIPLE_CHARS_REGEX
@@ -55,12 +43,9 @@ final class YoutubeThrottlingParameterUtils {
5543
+ MULTIPLE_CHARS_REGEX + ")" + ARRAY_ACCESS_REGEX),
5644

5745
/*
58-
* The third regex matches the following text, where we want Wma:
46+
* The second regex matches the following text, where we want Wma:
5947
*
6048
* a.D&&(b="nn"[+a.D],WL(a),c=a.j[b]||null)&&(c=SDa[0](c),a.set(b,c),SDa.length||Wma("")
61-
*
62-
* UPDATE: This is prone to find the wrong function on recent version of the player.
63-
* For this reason a regex which finds the Array + index should be preferred / above.
6449
*/
6550
Pattern.compile(SINGLE_CHAR_VARIABLE_REGEX + "=\"nn\"\\[\\+" + MULTIPLE_CHARS_REGEX
6651
+ "\\." + MULTIPLE_CHARS_REGEX + "]," + MULTIPLE_CHARS_REGEX + "\\("
@@ -69,6 +54,18 @@ final class YoutubeThrottlingParameterUtils {
6954
+ MULTIPLE_CHARS_REGEX + "]\\|\\|null\\).+\\|\\|(" + MULTIPLE_CHARS_REGEX
7055
+ ")\\(\"\"\\)"),
7156

57+
/*
58+
* The third regex matches the following text, where we want SDa and the array index
59+
* accessed:
60+
*
61+
* WL(a),c=a.j[b]||null)&&(c=SDa[0](
62+
*/
63+
Pattern.compile(MULTIPLE_CHARS_REGEX + "\\("
64+
+ MULTIPLE_CHARS_REGEX + "\\)," + MULTIPLE_CHARS_REGEX + "="
65+
+ MULTIPLE_CHARS_REGEX + "\\." + MULTIPLE_CHARS_REGEX + "\\["
66+
+ MULTIPLE_CHARS_REGEX + "]\\|\\|null\\)&&\\(" + MULTIPLE_CHARS_REGEX + "=("
67+
+ MULTIPLE_CHARS_REGEX + ")" + ARRAY_ACCESS_REGEX + "\\("),
68+
7269
/*
7370
* The fourth regex matches the following text, where we want rma:
7471
*

0 commit comments

Comments
 (0)