Skip to content

Commit a60bb3e

Browse files
committed
[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.
1 parent ecd3f6c commit a60bb3e

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

app/src/main/java/org/schabi/newpipe/util/potoken/PoTokenWebView.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ class PoTokenWebView private constructor(
8989
Log.d(TAG, "downloadAndRunBotguard() called")
9090
}
9191

92-
makeJnnPaGoogleapisRequest(
93-
"https://jnn-pa.googleapis.com/\$rpc/google.internal.waa.v1.Waa/Create",
92+
makeBotguardServiceRequest(
93+
"https://www.youtube.com/api/jnn/v1/Create",
9494
"[ \"$REQUEST_KEY\" ]",
9595
) { responseBody ->
9696
webView.evaluateJavascript(
@@ -129,8 +129,8 @@ class PoTokenWebView private constructor(
129129
if (BuildConfig.DEBUG) {
130130
Log.d(TAG, "botguardResponse: $botguardResponse")
131131
}
132-
makeJnnPaGoogleapisRequest(
133-
"https://jnn-pa.googleapis.com/\$rpc/google.internal.waa.v1.Waa/GenerateIT",
132+
makeBotguardServiceRequest(
133+
"https://www.youtube.com/api/jnn/v1/GenerateIT",
134134
"[ \"$REQUEST_KEY\", \"$botguardResponse\" ]",
135135
) { responseBody ->
136136
if (BuildConfig.DEBUG) {
@@ -252,7 +252,7 @@ class PoTokenWebView private constructor(
252252
* successful. The request is performed in the background and a disposable is added to
253253
* [disposables].
254254
*/
255-
private fun makeJnnPaGoogleapisRequest(
255+
private fun makeBotguardServiceRequest(
256256
url: String,
257257
data: String,
258258
handleResponseBody: (String) -> Unit,

0 commit comments

Comments
 (0)