From 03d935343250263741fcca18adbe65e3c2de9cf3 Mon Sep 17 00:00:00 2001 From: scb261 <65343233+scb261@users.noreply.github.com> Date: Wed, 3 Mar 2021 15:55:16 +0200 Subject: [PATCH] MangaRaw: add referer to fix images (#6025) --- src/ja/mangaraw/build.gradle | 2 +- .../eu/kanade/tachiyomi/extension/ja/mangaraw/MangaRaw.kt | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/ja/mangaraw/build.gradle b/src/ja/mangaraw/build.gradle index 0ea13cc56..a6e8406b6 100644 --- a/src/ja/mangaraw/build.gradle +++ b/src/ja/mangaraw/build.gradle @@ -5,7 +5,7 @@ ext { extName = 'MangaRaw' pkgNameSuffix = 'ja.mangaraw' extClass = '.MangaRawFactory' - extVersionCode = 1 + extVersionCode = 2 libVersion = '1.2' } diff --git a/src/ja/mangaraw/src/eu/kanade/tachiyomi/extension/ja/mangaraw/MangaRaw.kt b/src/ja/mangaraw/src/eu/kanade/tachiyomi/extension/ja/mangaraw/MangaRaw.kt index a27164632..c92ace123 100644 --- a/src/ja/mangaraw/src/eu/kanade/tachiyomi/extension/ja/mangaraw/MangaRaw.kt +++ b/src/ja/mangaraw/src/eu/kanade/tachiyomi/extension/ja/mangaraw/MangaRaw.kt @@ -6,6 +6,8 @@ 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.Protocol import org.jsoup.nodes.Document import org.jsoup.nodes.Element @@ -19,10 +21,14 @@ abstract class MangaRaw( override val supportsLatest = true - override val client = network.cloudflareClient.newBuilder() + override val client: OkHttpClient = network.cloudflareClient.newBuilder() .protocols(listOf(Protocol.HTTP_1_1)) .build() + override fun headersBuilder(): Headers.Builder { + return super.headersBuilder().add("Referer", baseUrl) + } + override fun popularMangaRequest(page: Int) = GET("$baseUrl/seachlist/page/$page/?cat=-1", headers) override fun popularMangaSelector() = "article"