From 6b7fda2285e2156db055bd37f4069795199a52a1 Mon Sep 17 00:00:00 2001 From: rs <96896020+rs1703@users.noreply.github.com> Date: Mon, 14 Mar 2022 17:21:55 +0700 Subject: [PATCH] update image url (#11095) --- src/en/koushoku/build.gradle | 2 +- .../kanade/tachiyomi/extension/en/koushoku/Koushoku.kt | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/en/koushoku/build.gradle b/src/en/koushoku/build.gradle index 8ada26b84..a90eb9178 100644 --- a/src/en/koushoku/build.gradle +++ b/src/en/koushoku/build.gradle @@ -5,7 +5,7 @@ ext { extName = 'Koushoku' pkgNameSuffix = 'en.koushoku' extClass = '.Koushoku' - extVersionCode = 1 + extVersionCode = 2 isNsfw = true } diff --git a/src/en/koushoku/src/eu/kanade/tachiyomi/extension/en/koushoku/Koushoku.kt b/src/en/koushoku/src/eu/kanade/tachiyomi/extension/en/koushoku/Koushoku.kt index 3d86d41e8..4e53f4cdd 100644 --- a/src/en/koushoku/src/eu/kanade/tachiyomi/extension/en/koushoku/Koushoku.kt +++ b/src/en/koushoku/src/eu/kanade/tachiyomi/extension/en/koushoku/Koushoku.kt @@ -18,6 +18,7 @@ import okhttp3.Response import org.jsoup.nodes.Document import org.jsoup.nodes.Element import rx.Observable +import java.net.URL class Koushoku : ParsedHttpSource() { companion object { @@ -45,7 +46,7 @@ class Koushoku : ParsedHttpSource() { override fun latestUpdatesFromElement(element: Element) = SManga.create().apply { setUrlWithoutDomain(element.select("a").attr("href")) title = element.select(".title").text() - thumbnail_url = "$baseUrl${element.select(thumbnailSelector).attr("src")}" + thumbnail_url = element.select(thumbnailSelector).attr("src") } private fun searchMangaByIdRequest(id: String) = GET("$baseUrl/archive/$id", headers) @@ -99,7 +100,7 @@ class Koushoku : ParsedHttpSource() { override fun mangaDetailsParse(document: Document) = SManga.create().apply { title = document.select(".metadata .title").text() - thumbnail_url = "$baseUrl${document.select(thumbnailSelector).attr("src")}" + thumbnail_url = document.select(thumbnailSelector).attr("src") artist = document.select(".metadata .artists a, .metadata .circles a") .joinToString { it.text() } author = artist @@ -139,8 +140,11 @@ class Koushoku : ParsedHttpSource() { if (id.isNullOrEmpty()) throw UnsupportedOperationException("Error: Unknown archive id") + val url = URL(document.selectFirst(".page img").attr("src")) + val origin = "${url.protocol}://${url.host}" + return (1..totalPages).map { - Page(it, "", "$baseUrl/data/$id/$it.jpg") + Page(it, "", "$origin/data/$id/$it.jpg") } }