From f05b4f13e90827520d67f7579327fd52c8e42360 Mon Sep 17 00:00:00 2001 From: Chopper <156493704+choppeh@users.noreply.github.com> Date: Sat, 28 Sep 2024 03:34:14 -0300 Subject: [PATCH] Bakai: Fix headers and change network client (#5272) Fix headers and cloudflare --- src/pt/bakai/build.gradle | 2 +- .../eu/kanade/tachiyomi/extension/pt/bakai/Bakai.kt | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/pt/bakai/build.gradle b/src/pt/bakai/build.gradle index d3a9ec476..1574b2f05 100644 --- a/src/pt/bakai/build.gradle +++ b/src/pt/bakai/build.gradle @@ -1,7 +1,7 @@ ext { extName = 'Bakai' extClass = '.Bakai' - extVersionCode = 4 + extVersionCode = 5 isNsfw = true } diff --git a/src/pt/bakai/src/eu/kanade/tachiyomi/extension/pt/bakai/Bakai.kt b/src/pt/bakai/src/eu/kanade/tachiyomi/extension/pt/bakai/Bakai.kt index 15f01fe76..b94359176 100644 --- a/src/pt/bakai/src/eu/kanade/tachiyomi/extension/pt/bakai/Bakai.kt +++ b/src/pt/bakai/src/eu/kanade/tachiyomi/extension/pt/bakai/Bakai.kt @@ -33,7 +33,7 @@ class Bakai : ParsedHttpSource() { override val supportsLatest = false override val client by lazy { - network.client.newBuilder() + network.cloudflareClient.newBuilder() .rateLimitHost(baseUrl.toHttpUrl(), 1, 2, TimeUnit.SECONDS) .cookieJar( object : CookieJar { @@ -53,6 +53,14 @@ class Bakai : ParsedHttpSource() { .build() } + override fun headersBuilder() = super.headersBuilder() + .set("Referer", baseUrl) + .set("Cache-Control", "no-cache") + .set("Sec-Fetch-Dest", "image") + .set("Sec-Fetch-Mode", "no-cors") + .set("Sec-Fetch-Site", "same-site") + .set("Sec-GPC", "1") + // ============================== Popular =============================== override fun popularMangaRequest(page: Int) = GET("$baseUrl/home3/page/$page/")