From 4a198a16e5b7e4fdcd4dfdf89531f13949c96904 Mon Sep 17 00:00:00 2001 From: Vetle Ledaal Date: Sat, 16 Sep 2023 15:38:45 +0000 Subject: [PATCH] ManhwaDesu: fix thumbnails, update domain (#17973) --- .../mangathemesia/manhwadesu/src/ManhwaDesu.kt | 15 ++++++++++++++- .../mangathemesia/MangaThemesiaGenerator.kt | 2 +- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/multisrc/overrides/mangathemesia/manhwadesu/src/ManhwaDesu.kt b/multisrc/overrides/mangathemesia/manhwadesu/src/ManhwaDesu.kt index b6669bb50..13ec37cbf 100644 --- a/multisrc/overrides/mangathemesia/manhwadesu/src/ManhwaDesu.kt +++ b/multisrc/overrides/mangathemesia/manhwadesu/src/ManhwaDesu.kt @@ -3,10 +3,23 @@ package eu.kanade.tachiyomi.extension.id.manhwadesu import eu.kanade.tachiyomi.multisrc.mangathemesia.MangaThemesia import eu.kanade.tachiyomi.network.interceptor.rateLimit import okhttp3.OkHttpClient +import org.jsoup.nodes.Element -class ManhwaDesu : MangaThemesia("ManhwaDesu", "https://manhwadesu.org", "id", "/komik") { +class ManhwaDesu : MangaThemesia("ManhwaDesu", "https://manhwadesu.one", "id", "/komik") { override val client: OkHttpClient = super.client.newBuilder() .rateLimit(4) .build() + + override fun Element.imgAttr(): String { + attributes() + .find { it.key.endsWith("original-src") } + ?.let { return absUrl(it.key) } + + return when { + hasAttr("data-lazy-src") -> attr("abs:data-lazy-src") + hasAttr("data-src") -> attr("abs:data-src") + else -> attr("abs:src") + } + } } diff --git a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/mangathemesia/MangaThemesiaGenerator.kt b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/mangathemesia/MangaThemesiaGenerator.kt index deda758d3..519732362 100644 --- a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/mangathemesia/MangaThemesiaGenerator.kt +++ b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/mangathemesia/MangaThemesiaGenerator.kt @@ -81,7 +81,7 @@ class MangaThemesiaGenerator : ThemeSourceGenerator { SingleLang("Mangás Chan", "https://mangaschan.net", "pt-BR", className = "MangasChan", overrideVersionCode = 1), SingleLang("Manhwa Freak", "https://manhwa-freak.com", "en", overrideVersionCode = 2), SingleLang("ManhwaFreak", "https://manhwafreak.fr", "fr", className = "ManhwaFreakFR"), - SingleLang("ManhwaDesu", "https://manhwadesu.org", "id", isNsfw = true, overrideVersionCode = 3), + SingleLang("ManhwaDesu", "https://manhwadesu.one", "id", isNsfw = true, overrideVersionCode = 4), SingleLang("ManhwaIndo", "https://manhwaindo.id", "id", isNsfw = true, overrideVersionCode = 2), SingleLang("ManhwaLand.mom", "https://manhwaland.lat", "id", isNsfw = true, className = "ManhwaLandMom", overrideVersionCode = 5), SingleLang("ManhwaList", "https://manhwalist.xyz", "id", overrideVersionCode = 3),