From fae36aebf46fb0f6c7561c250c561a97ed19b42e Mon Sep 17 00:00:00 2001 From: Taumer Date: Wed, 17 Jan 2018 15:32:54 +0300 Subject: [PATCH] Add referer to readmanga/mintmanga requests header (#1192) --- .../eu/kanade/tachiyomi/source/online/russian/Mintmanga.kt | 6 ++++++ .../eu/kanade/tachiyomi/source/online/russian/Readmanga.kt | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/app/src/main/java/eu/kanade/tachiyomi/source/online/russian/Mintmanga.kt b/app/src/main/java/eu/kanade/tachiyomi/source/online/russian/Mintmanga.kt index dd1a765ad8..066be0e5c6 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/source/online/russian/Mintmanga.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/source/online/russian/Mintmanga.kt @@ -3,6 +3,7 @@ package eu.kanade.tachiyomi.source.online.russian import eu.kanade.tachiyomi.network.GET import eu.kanade.tachiyomi.source.model.* import eu.kanade.tachiyomi.source.online.ParsedHttpSource +import okhttp3.Headers import okhttp3.Request import okhttp3.Response import org.jsoup.nodes.Document @@ -23,6 +24,11 @@ class Mintmanga : ParsedHttpSource() { override val supportsLatest = true + override fun headersBuilder() = Headers.Builder().apply { + add("User-Agent", "Mozilla/5.0 (Windows NT 6.3; WOW64)") + add("Referer", baseUrl) + } + override fun popularMangaRequest(page: Int): Request = GET("$baseUrl/list?sortType=rate&offset=${70 * (page - 1)}&max=70", headers) diff --git a/app/src/main/java/eu/kanade/tachiyomi/source/online/russian/Readmanga.kt b/app/src/main/java/eu/kanade/tachiyomi/source/online/russian/Readmanga.kt index 296ccc6661..1fe8cbb657 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/source/online/russian/Readmanga.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/source/online/russian/Readmanga.kt @@ -3,6 +3,7 @@ package eu.kanade.tachiyomi.source.online.russian import eu.kanade.tachiyomi.network.GET import eu.kanade.tachiyomi.source.model.* import eu.kanade.tachiyomi.source.online.ParsedHttpSource +import okhttp3.Headers import okhttp3.Request import okhttp3.Response import org.jsoup.nodes.Document @@ -23,6 +24,11 @@ class Readmanga : ParsedHttpSource() { override val supportsLatest = true + override fun headersBuilder() = Headers.Builder().apply { + add("User-Agent", "Mozilla/5.0 (Windows NT 6.3; WOW64)") + add("Referer", baseUrl) + } + override fun popularMangaSelector() = "div.desc" override fun latestUpdatesSelector() = "div.desc"