1
0
mirror of https://github.com/TeamNewPipe/NewPipe synced 2025-02-08 15:10: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:
AudricV 2025-02-03 13:05:39 +01:00
parent ecd3f6c2ee
commit a60bb3e7af
No known key found for this signature in database
GPG Key ID: DA92EC7905614198

View File

@ -89,8 +89,8 @@ class PoTokenWebView private constructor(
Log.d(TAG, "downloadAndRunBotguard() called")
}
makeJnnPaGoogleapisRequest(
"https://jnn-pa.googleapis.com/\$rpc/google.internal.waa.v1.Waa/Create",
makeBotguardServiceRequest(
"https://www.youtube.com/api/jnn/v1/Create",
"[ \"$REQUEST_KEY\" ]",
) { responseBody ->
webView.evaluateJavascript(
@ -129,8 +129,8 @@ class PoTokenWebView private constructor(
if (BuildConfig.DEBUG) {
Log.d(TAG, "botguardResponse: $botguardResponse")
}
makeJnnPaGoogleapisRequest(
"https://jnn-pa.googleapis.com/\$rpc/google.internal.waa.v1.Waa/GenerateIT",
makeBotguardServiceRequest(
"https://www.youtube.com/api/jnn/v1/GenerateIT",
"[ \"$REQUEST_KEY\", \"$botguardResponse\" ]",
) { responseBody ->
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
* [disposables].
*/
private fun makeJnnPaGoogleapisRequest(
private fun makeBotguardServiceRequest(
url: String,
data: String,
handleResponseBody: (String) -> Unit,