KomikCast: add header (user agent, referer) (#7221)

try lessen cloudflare issue
use google.com referer
This commit is contained in:
Riztard Lanthorn 2021-05-25 19:21:14 +07:00 committed by GitHub
parent 4cfe1f462f
commit 964ad72e2c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View File

@ -8,6 +8,7 @@ import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import okhttp3.Headers
import okhttp3.HttpUrl.Companion.toHttpUrlOrNull
import okhttp3.OkHttpClient
import okhttp3.Request
@ -27,6 +28,10 @@ class KomikCast : WPMangaStream("Komik Cast", "https://komikcast.com", "id") {
.addNetworkInterceptor(rateLimitInterceptor)
.build()
override fun headersBuilder(): Headers.Builder = Headers.Builder()
.add("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36 Edg/90.0.818.62")
.add("Referer", "https://www.google.com")
override fun popularMangaSelector() = "div.list-update_item"
override fun popularMangaRequest(page: Int): Request {

View File

@ -34,7 +34,7 @@ class WPMangaStreamGenerator : ThemeSourceGenerator {
SingleLang("GURU Komik", "https://gurukomik.com", "id"),
SingleLang("Shea Manga", "https://sheamanga.my.id", "id"),
SingleLang("Komik AV", "https://komikav.com", "id"),
SingleLang("Komik Cast", "https://komikcast.com", "id", overrideVersionCode = 3), // make it from v0 to v3 to force update user who still use old standalone ext, they will need to migrate
SingleLang("Komik Cast", "https://komikcast.com", "id", overrideVersionCode = 4),
SingleLang("West Manga", "https://westmanga.info", "id"),
SingleLang("Komik GO", "https://komikgo.com", "id", overrideVersionCode = 1),
SingleLang("MangaSwat", "https://mangaswat.com", "ar"),