From 025224d9031b35996b386fb51dfc31253013f37b Mon Sep 17 00:00:00 2001 From: seew3l <90949336+seew3l@users.noreply.github.com> Date: Sat, 15 Apr 2023 09:05:39 -0500 Subject: [PATCH] InariManga: Update selectors (#16059) * Update selectors * Rebuild --- .../madara/inarimanga/src/InariManga.kt | 34 +++++++++++++++++-- .../tachiyomi/multisrc/madara/Madara.kt | 2 +- .../multisrc/madara/MadaraGenerator.kt | 2 +- 3 files changed, 34 insertions(+), 4 deletions(-) diff --git a/multisrc/overrides/madara/inarimanga/src/InariManga.kt b/multisrc/overrides/madara/inarimanga/src/InariManga.kt index 1bb4ff8ca..6fa129906 100644 --- a/multisrc/overrides/madara/inarimanga/src/InariManga.kt +++ b/multisrc/overrides/madara/inarimanga/src/InariManga.kt @@ -1,6 +1,8 @@ package eu.kanade.tachiyomi.extension.es.inarimanga import eu.kanade.tachiyomi.multisrc.madara.Madara +import eu.kanade.tachiyomi.source.model.SManga +import org.jsoup.nodes.Element import java.text.SimpleDateFormat import java.util.Locale @@ -10,8 +12,36 @@ class InariManga : Madara( "es", dateFormat = SimpleDateFormat("MMMM dd, yyyy", Locale("es")), ) { - override val mangaDetailsSelectorDescription = "div.manga-summary" - override val mangaDetailsSelectorThumbnail = "div.summary_image img.notUsed" // Dimensions of img are not suitable for Tachiyomi + override fun popularMangaSelector() = "div.page-listing-item div.post" + override val popularMangaUrlSelector = "div.p-2 > h6 > a" + + override fun searchMangaSelector() = "div.page-listing-item div.post" + private val searchMangaUrlSelector = "div.p-2 > h6 > a" + + override val mangaDetailsSelectorDescription = "div.card-body:has(h5:contains(Sinopsis))" + override val mangaDetailsSelectorThumbnail = "div.col-sticky-top > img" + override val mangaDetailsSelectorStatus = "div.card-body tr:has(th:contains(Estatus)) > td" + override val mangaDetailsSelectorGenre = "div.my-auto > div.inline-block > a" override val useLoadMoreSearch = false + override val useNewChapterEndpoint = true + + override fun chapterListSelector() = "tr.wp-manga-chapter" + override fun chapterDateSelector() = "time.chapter-release-date" + + override fun searchMangaFromElement(element: Element): SManga { + val manga = SManga.create() + + with(element) { + select(searchMangaUrlSelector).first()?.let { + manga.setUrlWithoutDomain(it.attr("abs:href")) + manga.title = it.ownText() + } + select("img").first()?.let { + manga.thumbnail_url = imageFromElement(it) + } + } + + return manga + } } diff --git a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/madara/Madara.kt b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/madara/Madara.kt index 5a80cdb5c..259297b15 100644 --- a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/madara/Madara.kt +++ b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/madara/Madara.kt @@ -734,7 +734,7 @@ abstract class Madara( "OnGoing", "Продолжается", "Updating", "Em Lançamento", "Em lançamento", "Em andamento", "Em Andamento", "En cours", "Ativo", "Lançando", "Đang Tiến Hành", "Devam Ediyor", "Devam ediyor", "In Corso", "In Arrivo", "مستمرة", "مستمر", "En Curso", "En curso", "Emision", - "En marcha", "Publicandose", "连载中", + "En marcha", "Publicandose", "En emision", "连载中", ) protected val hiatusStatusList: Array = arrayOf( 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 2c0450abd..c72146e2d 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 @@ -148,7 +148,7 @@ class MadaraGenerator : ThemeSourceGenerator { SingleLang("Illusion Scan", "https://illusionscan.com", "pt-BR", isNsfw = true), SingleLang("Immortal Updates", "https://immortalupdates.com", "en", overrideVersionCode = 6), SingleLang("Império Scans", "https://imperioscans.com.br", "pt-BR", className = "ImperioScans", overrideVersionCode = 1), - SingleLang("InariManga", "https://inarimanga.com", "es"), + SingleLang("InariManga", "https://inarimanga.com", "es", overrideVersionCode = 1), SingleLang("Inazu Manga", "https://inazumanga.com", "id", isNsfw = true), SingleLang("InfraFandub", "https://infrafandub.xyz", "es"), SingleLang("Inmortal Scan", "https://manga.mundodrama.site", "es"),