From afe8ece417ae61a0f893fa3a8f8f00fae0181d98 Mon Sep 17 00:00:00 2001 From: Riztard Lanthorn Date: Tue, 23 Mar 2021 00:13:45 +0700 Subject: [PATCH] WebNovel.com: fix pages issue (#6249) --- src/en/webnovel/build.gradle | 2 +- .../eu/kanade/tachiyomi/extension/en/webnovel/Webnovel.kt | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/en/webnovel/build.gradle b/src/en/webnovel/build.gradle index 857410c8c..67150fc07 100644 --- a/src/en/webnovel/build.gradle +++ b/src/en/webnovel/build.gradle @@ -5,7 +5,7 @@ ext { extName = 'Webnovel.com' pkgNameSuffix = 'en.webnovel' extClass = '.Webnovel' - extVersionCode = 2 + extVersionCode = 3 libVersion = '1.2' } diff --git a/src/en/webnovel/src/eu/kanade/tachiyomi/extension/en/webnovel/Webnovel.kt b/src/en/webnovel/src/eu/kanade/tachiyomi/extension/en/webnovel/Webnovel.kt index 067091d5b..5d935d12b 100644 --- a/src/en/webnovel/src/eu/kanade/tachiyomi/extension/en/webnovel/Webnovel.kt +++ b/src/en/webnovel/src/eu/kanade/tachiyomi/extension/en/webnovel/Webnovel.kt @@ -7,6 +7,7 @@ import eu.kanade.tachiyomi.source.model.Page import eu.kanade.tachiyomi.source.model.SChapter import eu.kanade.tachiyomi.source.model.SManga import eu.kanade.tachiyomi.source.online.ParsedHttpSource +import okhttp3.Headers import okhttp3.OkHttpClient import okhttp3.Request import okhttp3.Response @@ -30,6 +31,11 @@ class Webnovel : ParsedHttpSource() { private val dateFormat: SimpleDateFormat = SimpleDateFormat("MMM dd,yyyy", Locale.US) + override fun headersBuilder() = Headers.Builder().apply { + add("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:86.0) Gecko/20100101 Firefox/86.0 ") + add("Referer", baseUrl) + } + // popular override fun popularMangaRequest(page: Int) = GET("$baseUrl/category/0_comic_page$page", headers)