Bakai: Fix headers and change network client (#5272)

Fix headers and cloudflare
This commit is contained in:
Chopper 2024-09-28 03:34:14 -03:00 committed by GitHub
parent 3abdb00df6
commit f05b4f13e9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 2 deletions

View File

@ -1,7 +1,7 @@
ext { ext {
extName = 'Bakai' extName = 'Bakai'
extClass = '.Bakai' extClass = '.Bakai'
extVersionCode = 4 extVersionCode = 5
isNsfw = true isNsfw = true
} }

View File

@ -33,7 +33,7 @@ class Bakai : ParsedHttpSource() {
override val supportsLatest = false override val supportsLatest = false
override val client by lazy { override val client by lazy {
network.client.newBuilder() network.cloudflareClient.newBuilder()
.rateLimitHost(baseUrl.toHttpUrl(), 1, 2, TimeUnit.SECONDS) .rateLimitHost(baseUrl.toHttpUrl(), 1, 2, TimeUnit.SECONDS)
.cookieJar( .cookieJar(
object : CookieJar { object : CookieJar {
@ -53,6 +53,14 @@ class Bakai : ParsedHttpSource() {
.build() .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 =============================== // ============================== Popular ===============================
override fun popularMangaRequest(page: Int) = GET("$baseUrl/home3/page/$page/") override fun popularMangaRequest(page: Int) = GET("$baseUrl/home3/page/$page/")