Skip to content

Commit 14f7ef1

Browse files
gechotoStypox
authored andcommitted
YoutubeThrottlingParameterUtils: add back second regex and swap it with the third one
1 parent d007e36 commit 14f7ef1

1 file changed

Lines changed: 18 additions & 18 deletions

File tree

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

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -42,35 +42,35 @@ final class YoutubeThrottlingParameterUtils {
4242
+ MULTIPLE_CHARS_REGEX + ")" + ARRAY_ACCESS_REGEX + "\\("),
4343

4444
/*
45-
* This regex matches the following text, where we want Wma:
45+
* The second regex matches the following text, where we want SDa and the array index
46+
* accessed:
4647
*
4748
* a.D&&(b="nn"[+a.D],WL(a),c=a.j[b]||null)&&(c=SDa[0](c),a.set(b,c),SDa.length||Wma("")
48-
*
49-
* UPDATE: This is broken and Wma is not the function needed anymore.
50-
* We need the function which is in SDa[0] instead.
5149
*/
52-
// Pattern.compile(SINGLE_CHAR_VARIABLE_REGEX + "=\"nn\"\\[\\+" + MULTIPLE_CHARS_REGEX
53-
// + "\\." + MULTIPLE_CHARS_REGEX + "]," + MULTIPLE_CHARS_REGEX + "\\("
54-
// + MULTIPLE_CHARS_REGEX + "\\)," + MULTIPLE_CHARS_REGEX + "="
55-
// + MULTIPLE_CHARS_REGEX + "\\." + MULTIPLE_CHARS_REGEX + "\\["
56-
// + MULTIPLE_CHARS_REGEX + "]\\|\\|null\\).+\\|\\|(" + MULTIPLE_CHARS_REGEX
57-
// + ")\\(\"\"\\)"),
50+
Pattern.compile(SINGLE_CHAR_VARIABLE_REGEX + "=\"nn\"\\[\\+" + MULTIPLE_CHARS_REGEX
51+
+ "\\." + MULTIPLE_CHARS_REGEX + "]," + MULTIPLE_CHARS_REGEX + "\\("
52+
+ MULTIPLE_CHARS_REGEX + "\\)," + MULTIPLE_CHARS_REGEX + "="
53+
+ MULTIPLE_CHARS_REGEX + "\\." + MULTIPLE_CHARS_REGEX + "\\["
54+
+ MULTIPLE_CHARS_REGEX + "]\\|\\|null\\)&&\\(" + MULTIPLE_CHARS_REGEX + "=("
55+
+ MULTIPLE_CHARS_REGEX + ")" + ARRAY_ACCESS_REGEX),
5856

5957
/*
60-
* The second regex matches the following text, where we want SDa and the array index
61-
* accessed:
58+
* The third regex matches the following text, where we want Wma:
6259
*
6360
* 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.
6464
*/
6565
Pattern.compile(SINGLE_CHAR_VARIABLE_REGEX + "=\"nn\"\\[\\+" + MULTIPLE_CHARS_REGEX
6666
+ "\\." + MULTIPLE_CHARS_REGEX + "]," + MULTIPLE_CHARS_REGEX + "\\("
6767
+ MULTIPLE_CHARS_REGEX + "\\)," + MULTIPLE_CHARS_REGEX + "="
6868
+ MULTIPLE_CHARS_REGEX + "\\." + MULTIPLE_CHARS_REGEX + "\\["
69-
+ MULTIPLE_CHARS_REGEX + "]\\|\\|null\\)&&\\(" + MULTIPLE_CHARS_REGEX + "=("
70-
+ MULTIPLE_CHARS_REGEX + ")" + ARRAY_ACCESS_REGEX),
69+
+ MULTIPLE_CHARS_REGEX + "]\\|\\|null\\).+\\|\\|(" + MULTIPLE_CHARS_REGEX
70+
+ ")\\(\"\"\\)"),
7171

7272
/*
73-
* The third regex matches the following text, where we want rma:
73+
* The fourth regex matches the following text, where we want rma:
7474
*
7575
* a.D&&(b="nn"[+a.D],c=a.get(b))&&(c=rDa[0](c),a.set(b,c),rDa.length||rma("")
7676
*/
@@ -80,7 +80,7 @@ final class YoutubeThrottlingParameterUtils {
8080
+ MULTIPLE_CHARS_REGEX + ")\\(\"\"\\)"),
8181

8282
/*
83-
* The fourth regex matches the following text, where we want rDa and the array index
83+
* The fifth regex matches the following text, where we want rDa and the array index
8484
* accessed:
8585
*
8686
* a.D&&(b="nn"[+a.D],c=a.get(b))&&(c=rDa[0](c),a.set(b,c),rDa.length||rma("")
@@ -91,7 +91,7 @@ final class YoutubeThrottlingParameterUtils {
9191
+ MULTIPLE_CHARS_REGEX + "=(" + MULTIPLE_CHARS_REGEX + ")\\[(\\d+)]"),
9292

9393
/*
94-
* The fifth regex matches the following text, where we want BDa and the array index
94+
* The sixth regex matches the following text, where we want BDa and the array index
9595
* accessed:
9696
*
9797
* (b=String.fromCharCode(110),c=a.get(b))&&(c=BDa[0](c)
@@ -103,7 +103,7 @@ final class YoutubeThrottlingParameterUtils {
103103
+ SINGLE_CHAR_VARIABLE_REGEX + "\\)"),
104104

105105
/*
106-
* The sixth regex matches the following text, where we want Yva and the array index
106+
* The seventh regex matches the following text, where we want Yva and the array index
107107
* accessed:
108108
*
109109
* .get("n"))&&(b=Yva[0](b)

0 commit comments

Comments
 (0)