From 13f41aaaebce139df916dbc599f511b99025d920 Mon Sep 17 00:00:00 2001 From: bapeey <90949336+bapeey@users.noreply.github.com> Date: Thu, 26 Oct 2023 19:50:18 -0500 Subject: [PATCH] Fix some Madara sources (#18729) * Fix some sources * Change Taurus domain * Update SamuraiScan domain --- .../madara/manhwadashraw/src/ManhwaDashRaw.kt | 4 ++ .../madara/manhwalatino/src/ManhwaLatino.kt | 2 +- .../madara/samuraiscan/src/SamuraiScan.kt | 12 ++++- .../madara/taurusfansub/src/TaurusFansub.kt | 48 ++++++++++++++++++- .../multisrc/madara/MadaraGenerator.kt | 8 ++-- 5 files changed, 67 insertions(+), 7 deletions(-) diff --git a/multisrc/overrides/madara/manhwadashraw/src/ManhwaDashRaw.kt b/multisrc/overrides/madara/manhwadashraw/src/ManhwaDashRaw.kt index 125fc5276..934c25d3f 100644 --- a/multisrc/overrides/madara/manhwadashraw/src/ManhwaDashRaw.kt +++ b/multisrc/overrides/madara/manhwadashraw/src/ManhwaDashRaw.kt @@ -11,4 +11,8 @@ class ManhwaDashRaw : Madara( dateFormat = SimpleDateFormat("dd/MM/yyy", Locale.ROOT), ) { override val useNewChapterEndpoint = true + + override val mangaDetailsSelectorStatus = "div.post-content_item:contains(Status) > div.summary-content" + override val mangaDetailsSelectorDescription = "div.post-content_item:contains(Summary) div.summary-container" + override val pageListParseSelector = "div.page-break img.wp-manga-chapter-img" } diff --git a/multisrc/overrides/madara/manhwalatino/src/ManhwaLatino.kt b/multisrc/overrides/madara/manhwalatino/src/ManhwaLatino.kt index 2fb139e7e..6e256c8e0 100644 --- a/multisrc/overrides/madara/manhwalatino/src/ManhwaLatino.kt +++ b/multisrc/overrides/madara/manhwalatino/src/ManhwaLatino.kt @@ -17,7 +17,7 @@ class ManhwaLatino : Madara( override val chapterUrlSelector = "div.mini-letters > a" override val mangaDetailsSelectorStatus = "div.post-content_item:contains(Estado del comic) > div.summary-content" - override val mangaDetailsSelectorDescription = "div.post-content_item:contains(Resumen) > h3 > div.summary-container" + override val mangaDetailsSelectorDescription = "div.post-content_item:contains(Resumen) div.summary-container" override val pageListParseSelector = "div.page-break img.wp-manga-chapter-img" override fun chapterFromElement(element: Element): SChapter { diff --git a/multisrc/overrides/madara/samuraiscan/src/SamuraiScan.kt b/multisrc/overrides/madara/samuraiscan/src/SamuraiScan.kt index 3b0c77fe4..d08135f51 100644 --- a/multisrc/overrides/madara/samuraiscan/src/SamuraiScan.kt +++ b/multisrc/overrides/madara/samuraiscan/src/SamuraiScan.kt @@ -4,4 +4,14 @@ import eu.kanade.tachiyomi.multisrc.madara.Madara import java.text.SimpleDateFormat import java.util.Locale -class SamuraiScan : Madara("SamuraiScan", "https://samuraiscan.org", "es", SimpleDateFormat("MMMM d, yyyy", Locale("es"))) +class SamuraiScan : Madara( + "SamuraiScan", + "https://samuraiscan.com", + "es", + SimpleDateFormat("MMMM d, yyyy", Locale("es")), +) { + override val useNewChapterEndpoint = true + + override val mangaDetailsSelectorDescription = "div.summary_content div.manga-summary" + override val mangaDetailsSelectorStatus = "div.summary_content div.manga-authors" +} diff --git a/multisrc/overrides/madara/taurusfansub/src/TaurusFansub.kt b/multisrc/overrides/madara/taurusfansub/src/TaurusFansub.kt index b4a38e878..aeb7b6928 100644 --- a/multisrc/overrides/madara/taurusfansub/src/TaurusFansub.kt +++ b/multisrc/overrides/madara/taurusfansub/src/TaurusFansub.kt @@ -1,14 +1,60 @@ package eu.kanade.tachiyomi.extension.es.taurusfansub import eu.kanade.tachiyomi.multisrc.madara.Madara +import eu.kanade.tachiyomi.network.POST +import eu.kanade.tachiyomi.network.interceptor.rateLimit +import okhttp3.FormBody +import okhttp3.Request import java.text.SimpleDateFormat import java.util.Locale +import java.util.concurrent.TimeUnit class TaurusFansub : Madara( "Taurus Fansub", - "https://taurusfansub.com", + "https://taurusmanga.com", "es", dateFormat = SimpleDateFormat("dd/MM/yyy", Locale.ROOT), ) { + override val client = super.client.newBuilder() + .rateLimit(2, 1, TimeUnit.SECONDS) + .build() + override val useNewChapterEndpoint = true + + override fun popularMangaNextPageSelector() = "body:not(:has(.no-posts))" + override val mangaDetailsSelectorDescription = "div.tab-summary > div.tab-content > div#tab-reducir > div.contenedor" + + private fun loadMoreRequest(page: Int, metaKey: String): Request { + val formBody = FormBody.Builder().apply { + add("action", "madara_load_more") + add("page", page.toString()) + add("template", "madara-core/content/content-archive") + add("vars[paged]", "1") + add("vars[orderby]", "meta_value_num") + add("vars[template]", "archive") + add("vars[sidebar]", "right") + add("vars[post_type]", "wp-manga") + add("vars[post_status]", "publish") + add("vars[meta_key]", metaKey) + add("vars[order]", "desc") + add("vars[meta_query][relation]", "OR") + add("vars[manga_archives_item_layout]", "big_thumbnail") + }.build() + + val xhrHeaders = headersBuilder() + .add("Content-Length", formBody.contentLength().toString()) + .add("Content-Type", formBody.contentType().toString()) + .add("X-Requested-With", "XMLHttpRequest") + .build() + + return POST("$baseUrl/wp-admin/admin-ajax.php", xhrHeaders, formBody) + } + + override fun popularMangaRequest(page: Int): Request { + return loadMoreRequest(page - 1, "_wp_manga_views") + } + + override fun latestUpdatesRequest(page: Int): Request { + return loadMoreRequest(page - 1, "_latest_update") + } } 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 7d90ad34e..4f66291f0 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 @@ -336,8 +336,8 @@ class MadaraGenerator : ThemeSourceGenerator { SingleLang("ManhuaUS", "https://manhuaus.com", "en", overrideVersionCode = 5), SingleLang("ManhuaZone", "https://manhuazone.org", "en", overrideVersionCode = 1), SingleLang("Manhwa Raw", "https://manhwaraw.com", "ko", isNsfw = true, overrideVersionCode = 1), - SingleLang("Manhwa-Latino", "https://manhwa-latino.com", "es", isNsfw = true, className = "ManhwaLatino", overrideVersionCode = 5), - SingleLang("Manhwa-raw", "https://manhwa-raw.com", "all", isNsfw = true, className = "ManhwaDashRaw"), + SingleLang("Manhwa-Latino", "https://manhwa-latino.com", "es", isNsfw = true, className = "ManhwaLatino", overrideVersionCode = 6), + SingleLang("Manhwa-raw", "https://manhwa-raw.com", "all", isNsfw = true, className = "ManhwaDashRaw", overrideVersionCode = 1), SingleLang("Manhwa18.app", "https://manhwa18.app", "en", isNsfw = true, className = "Manhwa18app"), SingleLang("Manhwa18.org", "https://manhwa18.org", "en", isNsfw = true, className = "Manhwa18Org", overrideVersionCode = 2), SingleLang("Manhwa2Read", "https://manhwa2read.com", "en", isNsfw = false), @@ -432,7 +432,7 @@ class MadaraGenerator : ThemeSourceGenerator { SingleLang("Rüya Manga", "https://www.ruyamanga.com", "tr", className = "RuyaManga", overrideVersionCode = 1), SingleLang("S2Manga", "https://www.s2manga.com", "en", overrideVersionCode = 2), SingleLang("Sagrado Império da Britannia", "https://imperiodabritannia.com", "pt-BR", className = "ImperioDaBritannia"), - SingleLang("SamuraiScan", "https://samuraiscan.org", "es", overrideVersionCode = 2), + SingleLang("SamuraiScan", "https://samuraiscan.com", "es", overrideVersionCode = 3), SingleLang("Sawamics", "https://sawamics.com", "en"), SingleLang("ScamberTraslator", "https://scambertraslator.com", "es", overrideVersionCode = 3), SingleLang("Scan Hentai Menu", "https://scan.hentai.menu", "fr", isNsfw = true, overrideVersionCode = 1), @@ -463,7 +463,7 @@ class MadaraGenerator : ThemeSourceGenerator { SingleLang("Tankou Hentai", "https://tankouhentai.com", "pt-BR", isNsfw = true), SingleLang("TappyToon.Net", "https://tappytoon.net", "en", className = "Tappytoonnet"), SingleLang("Tatakae Scan", "https://tatakaescan.com", "pt-BR", isNsfw = true, overrideVersionCode = 2), - SingleLang("Taurus Fansub", "https://taurusfansub.com", "es"), + SingleLang("Taurus Fansub", "https://taurusmanga.com", "es", overrideVersionCode = 1), SingleLang("TeenManhua", "https://teenmanhua.com", "en", overrideVersionCode = 1), SingleLang("TempleScan", "https://templescanesp.com", "es", isNsfw = true, className = "TempleScanEsp", overrideVersionCode = 1), SingleLang("The Beginning After The End", "https://www.thebeginningaftertheend.fr", "fr", overrideVersionCode = 1),