2
0
mirror of https://github.com/TeamNewPipe/NewPipeExtractor synced 2025-08-30 22:05:18 +00:00

YoutubeThrottlingParameterUtils: add back second regex and swap it with the third one

This commit is contained in:
gechoto
2025-01-05 20:39:53 +00:00
committed by Stypox
parent d007e368f3
commit 14f7ef1093

View File

@@ -41,21 +41,6 @@ final class YoutubeThrottlingParameterUtils {
+ MULTIPLE_CHARS_REGEX + "]\\|\\|null\\)&&\\(" + MULTIPLE_CHARS_REGEX + "=("
+ MULTIPLE_CHARS_REGEX + ")" + ARRAY_ACCESS_REGEX + "\\("),
/*
* This regex matches the following text, where we want Wma:
*
* a.D&&(b="nn"[+a.D],WL(a),c=a.j[b]||null)&&(c=SDa[0](c),a.set(b,c),SDa.length||Wma("")
*
* UPDATE: This is broken and Wma is not the function needed anymore.
* We need the function which is in SDa[0] instead.
*/
// Pattern.compile(SINGLE_CHAR_VARIABLE_REGEX + "=\"nn\"\\[\\+" + MULTIPLE_CHARS_REGEX
// + "\\." + MULTIPLE_CHARS_REGEX + "]," + MULTIPLE_CHARS_REGEX + "\\("
// + MULTIPLE_CHARS_REGEX + "\\)," + MULTIPLE_CHARS_REGEX + "="
// + MULTIPLE_CHARS_REGEX + "\\." + MULTIPLE_CHARS_REGEX + "\\["
// + MULTIPLE_CHARS_REGEX + "]\\|\\|null\\).+\\|\\|(" + MULTIPLE_CHARS_REGEX
// + ")\\(\"\"\\)"),
/*
* The second regex matches the following text, where we want SDa and the array index
* accessed:
@@ -70,7 +55,22 @@ final class YoutubeThrottlingParameterUtils {
+ MULTIPLE_CHARS_REGEX + ")" + ARRAY_ACCESS_REGEX),
/*
* The third regex matches the following text, where we want rma:
* The third regex matches the following text, where we want Wma:
*
* a.D&&(b="nn"[+a.D],WL(a),c=a.j[b]||null)&&(c=SDa[0](c),a.set(b,c),SDa.length||Wma("")
*
* UPDATE: This is prone to find the wrong function on recent version of the player.
* For this reason a regex which finds the Array + index should be preferred / above.
*/
Pattern.compile(SINGLE_CHAR_VARIABLE_REGEX + "=\"nn\"\\[\\+" + MULTIPLE_CHARS_REGEX
+ "\\." + MULTIPLE_CHARS_REGEX + "]," + MULTIPLE_CHARS_REGEX + "\\("
+ MULTIPLE_CHARS_REGEX + "\\)," + MULTIPLE_CHARS_REGEX + "="
+ MULTIPLE_CHARS_REGEX + "\\." + MULTIPLE_CHARS_REGEX + "\\["
+ MULTIPLE_CHARS_REGEX + "]\\|\\|null\\).+\\|\\|(" + MULTIPLE_CHARS_REGEX
+ ")\\(\"\"\\)"),
/*
* The fourth regex matches the following text, where we want rma:
*
* a.D&&(b="nn"[+a.D],c=a.get(b))&&(c=rDa[0](c),a.set(b,c),rDa.length||rma("")
*/
@@ -80,7 +80,7 @@ final class YoutubeThrottlingParameterUtils {
+ MULTIPLE_CHARS_REGEX + ")\\(\"\"\\)"),
/*
* The fourth regex matches the following text, where we want rDa and the array index
* The fifth regex matches the following text, where we want rDa and the array index
* accessed:
*
* 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 {
+ MULTIPLE_CHARS_REGEX + "=(" + MULTIPLE_CHARS_REGEX + ")\\[(\\d+)]"),
/*
* The fifth regex matches the following text, where we want BDa and the array index
* The sixth regex matches the following text, where we want BDa and the array index
* accessed:
*
* (b=String.fromCharCode(110),c=a.get(b))&&(c=BDa[0](c)
@@ -103,7 +103,7 @@ final class YoutubeThrottlingParameterUtils {
+ SINGLE_CHAR_VARIABLE_REGEX + "\\)"),
/*
* The sixth regex matches the following text, where we want Yva and the array index
* The seventh regex matches the following text, where we want Yva and the array index
* accessed:
*
* .get("n"))&&(b=Yva[0](b)