From dfbd58920a0f6eb2f8a1e76edd086ee43c69c435 Mon Sep 17 00:00:00 2001 From: Rafael M Date: Mon, 10 Sep 2018 06:04:25 -0500 Subject: [PATCH] RawLH/RawQQ image load fix (#486) RawLH/RawQQ image load fix --- src/ja/rawQQ/build.gradle | 4 ++-- .../eu/kanade/tachiyomi/extension/ja/rawqq/Rawqq.kt | 11 +++++++++++ src/ja/rawlh/build.gradle | 4 ++-- .../eu/kanade/tachiyomi/extension/ja/rawlh/Rawlh.kt | 8 ++++++++ 4 files changed, 23 insertions(+), 4 deletions(-) diff --git a/src/ja/rawQQ/build.gradle b/src/ja/rawQQ/build.gradle index bd3cf57db..9ced12145 100644 --- a/src/ja/rawQQ/build.gradle +++ b/src/ja/rawQQ/build.gradle @@ -5,8 +5,8 @@ ext { appName = 'Tachiyomi: RawQQ' pkgNameSuffix = 'ja.rawqq' extClass = '.Rawqq' - extVersionCode = 1 - extVersionSuffix = 0 + extVersionCode = 2 + extVersionSuffix = 1 libVersion = '1.2' } diff --git a/src/ja/rawQQ/src/eu/kanade/tachiyomi/extension/ja/rawqq/Rawqq.kt b/src/ja/rawQQ/src/eu/kanade/tachiyomi/extension/ja/rawqq/Rawqq.kt index 02a623bd0..16b803f55 100644 --- a/src/ja/rawQQ/src/eu/kanade/tachiyomi/extension/ja/rawqq/Rawqq.kt +++ b/src/ja/rawQQ/src/eu/kanade/tachiyomi/extension/ja/rawqq/Rawqq.kt @@ -3,6 +3,7 @@ package eu.kanade.tachiyomi.extension.ja.rawqq import eu.kanade.tachiyomi.network.GET import eu.kanade.tachiyomi.source.model.* import eu.kanade.tachiyomi.source.online.ParsedHttpSource +import okhttp3.Headers import okhttp3.HttpUrl import okhttp3.Request import org.jsoup.nodes.Document @@ -162,6 +163,16 @@ class Rawqq : ParsedHttpSource() { override fun imageUrlParse(document: Document) = "" + override fun imageRequest(page: Page): Request { + if (page.imageUrl!!.contains("lhscanlation.club")) { + val imgHeader = Headers.Builder().apply { + add("Referer", "https://lhscan.net") + }.build() + return GET(page.imageUrl!!, imgHeader) + } + return GET(page.imageUrl!!) + } + private class TextField(name: String, val key: String) : Filter.Text(name) private class Status : Filter.Select("Status", arrayOf("Any", "Completed", "Ongoing")) private class GenreList(genres: List) : Filter.Group("Genre", genres) diff --git a/src/ja/rawlh/build.gradle b/src/ja/rawlh/build.gradle index 045e8fb45..659098159 100644 --- a/src/ja/rawlh/build.gradle +++ b/src/ja/rawlh/build.gradle @@ -5,8 +5,8 @@ ext { appName = 'Tachiyomi: RawLH' pkgNameSuffix = 'ja.rawlh' extClass = '.Rawlh' - extVersionCode = 4 - extVersionSuffix = 2 + extVersionCode = 5 + extVersionSuffix = 3 libVersion = '1.2' } diff --git a/src/ja/rawlh/src/eu/kanade/tachiyomi/extension/ja/rawlh/Rawlh.kt b/src/ja/rawlh/src/eu/kanade/tachiyomi/extension/ja/rawlh/Rawlh.kt index ddad513e4..6b88eee2f 100644 --- a/src/ja/rawlh/src/eu/kanade/tachiyomi/extension/ja/rawlh/Rawlh.kt +++ b/src/ja/rawlh/src/eu/kanade/tachiyomi/extension/ja/rawlh/Rawlh.kt @@ -3,6 +3,7 @@ package eu.kanade.tachiyomi.extension.ja.rawlh import eu.kanade.tachiyomi.network.GET import eu.kanade.tachiyomi.source.model.* import eu.kanade.tachiyomi.source.online.ParsedHttpSource +import okhttp3.Headers import okhttp3.HttpUrl import okhttp3.Request import org.jsoup.nodes.Document @@ -159,6 +160,13 @@ class Rawlh : ParsedHttpSource() { override fun imageUrlParse(document: Document) = "" + override fun imageRequest(page: Page): Request { + val imgHeader = Headers.Builder().apply { + add("Referer", baseUrl) + }.build() + return GET(page.imageUrl!!, imgHeader) + } + private class TextField(name: String, val key: String) : Filter.Text(name) private class Status : Filter.Select("Status", arrayOf("Any", "Completed", "Ongoing")) private class GenreList(genres: List) : Filter.Group("Genre", genres)