From 2b9cdf6af7062bf8c8b0d24d0f7766b2a3073956 Mon Sep 17 00:00:00 2001 From: Riztard Lanthorn Date: Tue, 8 Dec 2020 20:07:09 +0700 Subject: [PATCH] update & fix Madara (#5056) update & fix Madara --- src/all/madara/build.gradle | 2 +- .../extension/all/madara/MadaraFactory.kt | 36 ++++++++----------- 2 files changed, 15 insertions(+), 23 deletions(-) diff --git a/src/all/madara/build.gradle b/src/all/madara/build.gradle index ce2d146cb..39139f80e 100644 --- a/src/all/madara/build.gradle +++ b/src/all/madara/build.gradle @@ -5,7 +5,7 @@ ext { extName = 'Madara (multiple sources)' pkgNameSuffix = "all.madara" extClass = '.MadaraFactory' - extVersionCode = 153 + extVersionCode = 154 libVersion = '1.2' containsNsfw = true } diff --git a/src/all/madara/src/eu/kanade/tachiyomi/extension/all/madara/MadaraFactory.kt b/src/all/madara/src/eu/kanade/tachiyomi/extension/all/madara/MadaraFactory.kt index f6521cb9d..c32334182 100644 --- a/src/all/madara/src/eu/kanade/tachiyomi/extension/all/madara/MadaraFactory.kt +++ b/src/all/madara/src/eu/kanade/tachiyomi/extension/all/madara/MadaraFactory.kt @@ -135,6 +135,7 @@ class MadaraFactory : SourceFactory { ManhuaPlus(), ManhuaUS(), ManhuasWorld(), + ManhuaSY(), Manhuasnet(), ManhwaRaw(), ManhwaTop(), @@ -218,6 +219,8 @@ class MadaraFactory : SourceFactory { ) } +class ManhuaSY : Madara("Manhua SY", "https://www.manhuasy.com", "en") + class MangaRave : Madara("MangaRave", "http://www.mangarave.com", "en") class NekoScan : Madara("NekoScan", "https://nekoscan.com", "en") @@ -428,27 +431,10 @@ class BoysLove : Madara("BoysLove", "https://boyslove.me", "en") class ChibiManga : Madara( "Chibi Manga", - "http://www.cmreader.info", + "https://www.cmreader.info", "en", - dateFormat = SimpleDateFormat("yyyy-MM-dd", Locale.US) -) { - override fun chapterListParse(response: Response): List { - response.asJsoup().let { documet -> - documet.select("li.parent.has-child").let { volumes -> - return if (volumes.isNullOrEmpty()) { - documet.select(chapterListSelector()).map { chapterFromElement(it) } - } else { - val chapters = mutableListOf() - volumes.reversed().forEach { v -> - val vName = v.select("a[href^=javascript]").text() - v.select(chapterListSelector()).map { chapters.add(chapterFromElement(it).apply { name = "$vName - $name" }) } - } - chapters - } - } - } - } -} + dateFormat = SimpleDateFormat("MMM dd, yyyy", Locale.US) +) class ZinManga : Madara("Zin Translator", "https://zinmanga.com", "en") { override fun headersBuilder(): Headers.Builder = super.headersBuilder() @@ -775,7 +761,7 @@ class MangaArabTeam : Madara("مانجا عرب تيم Manga Arab Team", "https: } } -class NightComic : Madara("Night Comic", "https://nightcomic.com", "en") { +class NightComic : Madara("Night Comic", "https://www.nightcomic.com", "en") { override val formHeaders: Headers = headersBuilder() .add("Content-Type", "application/x-www-form-urlencoded") .add("X-MOD-SBB-CTYPE", "xhr") @@ -862,8 +848,14 @@ class GoldenManga : Madara("موقع لترجمة المانجا", "https://gold class Mangalek : Madara("مانجا ليك", "https://mangalek.com", "ar", SimpleDateFormat("MMMM dd, yyyy", Locale("ar"))) -class AstralLibrary : Madara("Astral Library", "https://astrallibrary.net", "en", SimpleDateFormat("d MMM", Locale.US)) { +class AstralLibrary : Madara("Astral Library", "https://www.astrallibrary.net", "en", SimpleDateFormat("d MMM", Locale.US)) { override fun chapterListParse(response: Response): List = super.chapterListParse(response).reversed() + override fun popularMangaRequest(page: Int): Request { + return GET("$baseUrl/manga-tag/manga/?m_orderby=views&page=$page", headers) + } + override fun latestUpdatesRequest(page: Int): Request { + return GET("$baseUrl/manga-tag/manga/?m_orderby=latest&page=$page", headers) + } } class KlikManga : Madara("KlikManga", "https://klikmanga.com", "id", SimpleDateFormat("MMMM dd, yyyy", Locale("id")))