diff --git a/multisrc/overrides/madara/leviatanscans/src/LeviatanScansFactory.kt b/multisrc/overrides/madara/leviatanscans/src/LeviatanScansFactory.kt index 04857b198..3fd4f91f1 100644 --- a/multisrc/overrides/madara/leviatanscans/src/LeviatanScansFactory.kt +++ b/multisrc/overrides/madara/leviatanscans/src/LeviatanScansFactory.kt @@ -27,6 +27,8 @@ class LeviatanScansEN : Madara("Leviatan Scans", "https://leviatanscans.com", "e override fun chapterFromElement(element: Element) = replaceRandomUrlPartInChapter(super.chapterFromElement(element)) + + override val mangaDetailsSelectorDescription = "div.post-content div.manga-excerpt" } class LeviatanScansES : Madara("Leviatan Scans", "https://es.leviatanscans.com", "es") { override val useNewChapterEndpoint: Boolean = true 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 f5fc8d1d9..4beb425b5 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 @@ -319,20 +319,20 @@ abstract class Madara( override fun mangaDetailsParse(document: Document): SManga { val manga = SManga.create() with(document) { - select("div.post-title h3").first()?.let { + select(mangaDetailsSelectorTitle).first()?.let { manga.title = it.ownText() } - select("div.author-content > a").eachText().filter { + select(mangaDetailsSelectorAuthor).eachText().filter { it.notUpdating() }.joinToString().takeIf { it.isNotBlank() }?.let { manga.author = it } - select("div.artist-content > a").eachText().filter { + select(mangaDetailsSelectorArtist).eachText().filter { it.notUpdating() }.joinToString().takeIf { it.isNotBlank() }?.let { manga.artist = it } - select("div.description-summary div.summary__content").let { + select(mangaDetailsSelectorDescription).let { if (it.select("p").text().isNotEmpty()) { manga.description = it.select("p").joinToString(separator = "\n\n") { p -> p.text().replace("
", "\n") @@ -341,10 +341,10 @@ abstract class Madara( manga.description = it.text() } } - select("div.summary_image img").first()?.let { + select(mangaDetailsSelectorThumbnail).first()?.let { manga.thumbnail_url = imageFromElement(it) } - select("div.summary-content").last()?.let { + select(mangaDetailsSelectorStatus).last()?.let { manga.status = when (it.text()) { // I don't know what's the corresponding for COMPLETED and LICENSED // There's no support for "Canceled" or "On Hold" @@ -353,12 +353,12 @@ abstract class Madara( else -> SManga.UNKNOWN } } - val genres = select("div.genres-content a") + val genres = select(mangaDetailsSelectorGenre) .map { element -> element.text().toLowerCase(Locale.ROOT) } .toMutableSet() // add tag(s) to genre - select("div.tags-content a").forEach { element -> + select(mangaDetailsSelectorTag).forEach { element -> if (genres.contains(element.text()).not()) { genres.add(element.text().toLowerCase(Locale.ROOT)) } @@ -387,6 +387,16 @@ abstract class Madara( return manga } + // Manga Details Selector + open val mangaDetailsSelectorTitle = "div.post-title h3" + open val mangaDetailsSelectorAuthor = "div.author-content > a" + open val mangaDetailsSelectorArtist = "div.artist-content > a" + open val mangaDetailsSelectorStatus = "div.summary-content" + open val mangaDetailsSelectorDescription = "div.description-summary div.summary__content" + open val mangaDetailsSelectorThumbnail = "div.summary_image img" + open val mangaDetailsSelectorGenre = "div.genres-content a" + open val mangaDetailsSelectorTag = "div.tags-content a" + open val seriesTypeSelector = ".post-content_item:contains(Type) .summary-content" open val altNameSelector = ".post-content_item:contains(Alt) .summary-content" open val altName = "Alternative Name" + ": " 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 6578a9f4c..c9a526876 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 @@ -13,7 +13,7 @@ class MadaraGenerator : ThemeSourceGenerator { override val baseVersionCode: Int = 11 override val sources = listOf( - MultiLang("Leviatan Scans", "https://leviatanscans.com", listOf("en", "es"), className = "LeviatanScansFactory", overrideVersionCode = 8), + MultiLang("Leviatan Scans", "https://leviatanscans.com", listOf("en", "es"), className = "LeviatanScansFactory", overrideVersionCode = 9), MultiLang("MangaForFree.net", "https://mangaforfree.net", listOf("en", "ko", "all"), isNsfw = true, className = "MangaForFreeFactory", pkgName = "mangaforfree", overrideVersionCode = 1), MultiLang("Manhwa18.cc", "https://manhwa18.cc", listOf("en", "ko", "all"), isNsfw = true, className = "Manhwa18CcFactory", pkgName = "manhwa18cc"), MultiLang("Reaper Scans", "https://reaperscans.com", listOf("en", "pt-BR"), className = "ReaperScansFactory", pkgName = "reaperscans", overrideVersionCode = 2),