Alessandro Jean 1196434448
Fix wrong images in SS (#18499)
* Fix wrong images in SS.

* Undo visibility modifier change.
2023-10-11 23:07:33 -03:00

37 lines
1.2 KiB
Kotlin

package eu.kanade.tachiyomi.extension.pt.ssshentais
import eu.kanade.tachiyomi.multisrc.mangathemesia.MangaThemesia
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.network.interceptor.rateLimit
import eu.kanade.tachiyomi.source.model.Page
import okhttp3.OkHttpClient
import okhttp3.Request
import java.text.SimpleDateFormat
import java.util.Locale
import java.util.concurrent.TimeUnit
class SssHentais : MangaThemesia(
"SSS Hentais",
"https://hentais.sssscanlator.com",
"pt-BR",
dateFormat = SimpleDateFormat("MMMMM dd, yyyy", Locale("pt", "BR")),
) {
override val client: OkHttpClient = super.client.newBuilder()
.rateLimit(1, 2, TimeUnit.SECONDS)
.build()
override fun imageRequest(page: Page): Request {
val newHeaders = headersBuilder()
.set("Referer", page.url)
.set("Accept", "image/avif,image/webp,*/*")
.set("Accept-Language", "pt-BR,pt;q=0.8,en-US;q=0.5,en;q=0.3")
.set("Sec-Fetch-Dest", "image")
.set("Sec-Fetch-Mode", "no-cors")
.set("Sec-Fetch-Site", "same-origin")
.build()
return GET(page.imageUrl!!, newHeaders)
}
}