From 5a6027d59f138ade6ceb796c5c67ca0287fc30a9 Mon Sep 17 00:00:00 2001 From: KirinRaikage Date: Fri, 15 Sep 2023 20:58:08 +0200 Subject: [PATCH] Fix MangaHub.fr images not loading and remove dead source (#17951) --- .../madara/mangahubfr/src/MangaHubFr.kt | 20 ++++++++++++++++++- .../multisrc/madara/MadaraGenerator.kt | 3 +-- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/multisrc/overrides/madara/mangahubfr/src/MangaHubFr.kt b/multisrc/overrides/madara/mangahubfr/src/MangaHubFr.kt index 0c0d34632..2794d135b 100644 --- a/multisrc/overrides/madara/mangahubfr/src/MangaHubFr.kt +++ b/multisrc/overrides/madara/mangahubfr/src/MangaHubFr.kt @@ -1,7 +1,25 @@ package eu.kanade.tachiyomi.extension.fr.mangahubfr import eu.kanade.tachiyomi.multisrc.madara.Madara +import eu.kanade.tachiyomi.source.model.Page +import org.jsoup.nodes.Document import java.text.SimpleDateFormat import java.util.Locale -class MangaHubFr : Madara("MangaHub.fr", "https://mangahub.fr", "fr", dateFormat = SimpleDateFormat("d MMMM yyyy", Locale.FRENCH)) +class MangaHubFr : Madara("MangaHub.fr", "https://mangahub.fr", "fr", dateFormat = SimpleDateFormat("d MMMM yyyy", Locale.FRENCH)) { + // Only display chapters which don't have Premium + override fun chapterListSelector() = "li.wp-manga-chapter:not(.vip-permission)" + + override val chapterUrlSuffix = "" + + override fun pageListParse(document: Document): List { + countViews(document) + + return document.select(pageListParseSelector) + .mapIndexed { index, element -> + // Had to add trim because of white space in source. + val imageUrl = element.select("img").attr("abs:src").trim() + Page(index, document.location(), imageUrl) + } + } +} diff --git a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/madara/MadaraGenerator.kt b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/madara/MadaraGenerator.kt index 52686bbcf..083b03cac 100644 --- a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/madara/MadaraGenerator.kt +++ b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/madara/MadaraGenerator.kt @@ -267,7 +267,7 @@ class MadaraGenerator : ThemeSourceGenerator { SingleLang("MangaGG", "https://mangagg.com", "en", overrideVersionCode = 2), SingleLang("MangaGo Yaoi", "https://mangagoyaoi.com", "en", isNsfw = true), SingleLang("MangaGreat", "https://mangagreat.com", "en", overrideVersionCode = 4), - SingleLang("MangaHub.fr", "https://mangahub.fr", "fr", isNsfw = true, className = "MangaHubFr", pkgName = "mangahubfr", overrideVersionCode = 1), + SingleLang("MangaHub.fr", "https://mangahub.fr", "fr", isNsfw = true, className = "MangaHubFr", pkgName = "mangahubfr", overrideVersionCode = 2), SingleLang("MangaHZ", "https://www.mangahz.com", "en", isNsfw = true, overrideVersionCode = 2), SingleLang("MangaK2", "https://mangak2.com", "en", isNsfw = true), SingleLang("Mangakakalot.io (unoriginal)", "https://mangakakalot.io", "en", isNsfw = true, className = "MangakakalotIo"), @@ -295,7 +295,6 @@ class MadaraGenerator : ThemeSourceGenerator { SingleLang("MangaRosie", "https://mangarosie.in", "en", isNsfw = true), SingleLang("MangaRuby.com", "https://mangaruby.com", "en", isNsfw = true, className = "MangaRubyCom"), SingleLang("Mangaryu", "https://mangaryu.com", "en", isNsfw = true), - SingleLang("Mangas Origines X", "https://x.mangas-origines.fr", "fr", isNsfw = true), SingleLang("Mangas Origines", "https://mangas-origines.xyz", "fr", isNsfw = true, overrideVersionCode = 4), SingleLang("Mangas-Origines.fr", "https://mangas-origines.fr", "fr", className = "MangasOriginesFr"), SingleLang("MangaSco", "https://manhwasco.net", "en", overrideVersionCode = 2),