From ba008579b0da162cc83c8f114638a3f6bd6d7e94 Mon Sep 17 00:00:00 2001 From: Riztard Lanthorn Date: Mon, 19 Oct 2020 07:25:54 +0700 Subject: [PATCH] Update WP MangaStream (#4631) * add FlameScans * update new Mangastream manga detail * update ext version * Fix chapter date on SheaManga and KomikAV * keep old manga detail format for some sites Some wpmangastream sites still use old version manga detail layout --- src/all/wpmangastream/build.gradle | 2 +- .../all/wpmangastream/WPMangaStream.kt | 19 +++++++++++++----- .../all/wpmangastream/WPMangaStreamFactory.kt | 20 ++++++++++++++++--- 3 files changed, 32 insertions(+), 9 deletions(-) diff --git a/src/all/wpmangastream/build.gradle b/src/all/wpmangastream/build.gradle index b4f62a7c6..836bdc6c1 100644 --- a/src/all/wpmangastream/build.gradle +++ b/src/all/wpmangastream/build.gradle @@ -5,7 +5,7 @@ ext { extName = 'WP MangaStream (multiple sources)' pkgNameSuffix = 'all.wpmangastream' extClass = '.WPMangaStreamFactory' - extVersionCode = 27 + extVersionCode = 28 libVersion = '1.2' } diff --git a/src/all/wpmangastream/src/eu/kanade/tachiyomi/extension/all/wpmangastream/WPMangaStream.kt b/src/all/wpmangastream/src/eu/kanade/tachiyomi/extension/all/wpmangastream/WPMangaStream.kt index 2c0b2e9d3..b8ef6008e 100644 --- a/src/all/wpmangastream/src/eu/kanade/tachiyomi/extension/all/wpmangastream/WPMangaStream.kt +++ b/src/all/wpmangastream/src/eu/kanade/tachiyomi/extension/all/wpmangastream/WPMangaStream.kt @@ -163,12 +163,21 @@ abstract class WPMangaStream( override fun mangaDetailsParse(document: Document): SManga { return SManga.create().apply { document.select("div.bigcontent, div.animefull").firstOrNull()?.let { infoElement -> - genre = infoElement.select("span:contains(Genres:) a").joinToString { it.text() } - status = parseStatus(infoElement.select("span:contains(Status:)").firstOrNull()?.ownText()) - author = infoElement.select("span:contains(Author:)").firstOrNull()?.ownText() - artist = author - description = infoElement.select("div.desc p").joinToString("\n") { it.text() } + genre = infoElement.select(".mgen a").joinToString { it.text() } + status = parseStatus(infoElement.select(".imptdt:contains(Status) i").firstOrNull()?.ownText()) + author = infoElement.select(".fmed b:contains(Author)+span").firstOrNull()?.ownText() + artist = infoElement.select(".fmed b:contains(Artist)+span").firstOrNull()?.ownText() + description = infoElement.select("div.entry-content p").joinToString("\n") { it.text() } thumbnail_url = infoElement.select("div.thumb img").imgAttr() + + // Some wpmangastream sites still use old wpmangastream manga detail layout + if (author == artist && artist == null) { + genre = infoElement.select("span:contains(Genres:) a").joinToString { it.text() } + status = parseStatus(infoElement.select("span:contains(Status:)").firstOrNull()?.ownText()) + author = infoElement.select("span:contains(Author:)").firstOrNull()?.ownText() + artist = author + description = infoElement.select("div.desc p").joinToString("\n") { it.text() } + } } } } diff --git a/src/all/wpmangastream/src/eu/kanade/tachiyomi/extension/all/wpmangastream/WPMangaStreamFactory.kt b/src/all/wpmangastream/src/eu/kanade/tachiyomi/extension/all/wpmangastream/WPMangaStreamFactory.kt index 7e980d76b..8095bc203 100644 --- a/src/all/wpmangastream/src/eu/kanade/tachiyomi/extension/all/wpmangastream/WPMangaStreamFactory.kt +++ b/src/all/wpmangastream/src/eu/kanade/tachiyomi/extension/all/wpmangastream/WPMangaStreamFactory.kt @@ -51,11 +51,19 @@ class WPMangaStreamFactory : SourceFactory { Mangakyo(), AsuraScans(), SilenceScan(), - SheaManga() + SheaManga(), + FlameScans() ) } -class SheaManga : WPMangaStream("Shea Manga", "https://sheamanga.my.id", "id") +class FlameScans : WPMangaStream("Flame Scans", "https://www.flame-scans.com", "en") + +class SheaManga : WPMangaStream( + "Shea Manga", + "https://sheamanga.my.id", + "id", + dateFormat = SimpleDateFormat("MMMM dd, yyyy", Locale.forLanguageTag("id")) +) class AsuraScans : WPMangaStream("AsuraScans", "https://asurascans.com", "en") @@ -68,7 +76,13 @@ class Kiryuu : WPMangaStream("Kiryuu (WP Manga Stream)", "https://kiryuu.co", "i .mapIndexed { i, image -> Page(i, "", image) } } } -class KomikAV : WPMangaStream("Komik AV (WP Manga Stream)", "https://komikav.com", "id") + +class KomikAV : WPMangaStream( + "Komik AV (WP Manga Stream)", + "https://komikav.com", + "id", + dateFormat = SimpleDateFormat("MMMM dd, yyyy", Locale.forLanguageTag("id")) +) class KomikStation : WPMangaStream("Komik Station (WP Manga Stream)", "https://komikstation.com", "id")