mirror of
https://github.com/TeamNewPipe/NewPipe
synced 2025-02-13 01:20:07 +00:00
[YouTube] Change BotGuard endpoint to youtube.com's one
This prevents non-abilities to fetch BotGuard challenge and send its result with the jnn-pa.googleapis.com domain (domain block like done on Pi-hole lists or DNS servers). That's what the official website uses to send the challenge execution result, however it uses InnerTube to fetch the challenge. Embeds still use the jnn-pa.googleapis.com domain. Also rename the makeJnnPaGoogleapisRequest method appropriately.
This commit is contained in:
parent
ecd3f6c2ee
commit
a60bb3e7af
@ -89,8 +89,8 @@ class PoTokenWebView private constructor(
|
|||||||
Log.d(TAG, "downloadAndRunBotguard() called")
|
Log.d(TAG, "downloadAndRunBotguard() called")
|
||||||
}
|
}
|
||||||
|
|
||||||
makeJnnPaGoogleapisRequest(
|
makeBotguardServiceRequest(
|
||||||
"https://jnn-pa.googleapis.com/\$rpc/google.internal.waa.v1.Waa/Create",
|
"https://www.youtube.com/api/jnn/v1/Create",
|
||||||
"[ \"$REQUEST_KEY\" ]",
|
"[ \"$REQUEST_KEY\" ]",
|
||||||
) { responseBody ->
|
) { responseBody ->
|
||||||
webView.evaluateJavascript(
|
webView.evaluateJavascript(
|
||||||
@ -129,8 +129,8 @@ class PoTokenWebView private constructor(
|
|||||||
if (BuildConfig.DEBUG) {
|
if (BuildConfig.DEBUG) {
|
||||||
Log.d(TAG, "botguardResponse: $botguardResponse")
|
Log.d(TAG, "botguardResponse: $botguardResponse")
|
||||||
}
|
}
|
||||||
makeJnnPaGoogleapisRequest(
|
makeBotguardServiceRequest(
|
||||||
"https://jnn-pa.googleapis.com/\$rpc/google.internal.waa.v1.Waa/GenerateIT",
|
"https://www.youtube.com/api/jnn/v1/GenerateIT",
|
||||||
"[ \"$REQUEST_KEY\", \"$botguardResponse\" ]",
|
"[ \"$REQUEST_KEY\", \"$botguardResponse\" ]",
|
||||||
) { responseBody ->
|
) { responseBody ->
|
||||||
if (BuildConfig.DEBUG) {
|
if (BuildConfig.DEBUG) {
|
||||||
@ -252,7 +252,7 @@ class PoTokenWebView private constructor(
|
|||||||
* successful. The request is performed in the background and a disposable is added to
|
* successful. The request is performed in the background and a disposable is added to
|
||||||
* [disposables].
|
* [disposables].
|
||||||
*/
|
*/
|
||||||
private fun makeJnnPaGoogleapisRequest(
|
private fun makeBotguardServiceRequest(
|
||||||
url: String,
|
url: String,
|
||||||
data: String,
|
data: String,
|
||||||
handleResponseBody: (String) -> Unit,
|
handleResponseBody: (String) -> Unit,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user