From becbf4b442d89773f8cbd9049cdfc10b7122d1cc Mon Sep 17 00:00:00 2001 From: Vesnyx Date: Sat, 13 Jul 2019 13:36:25 +0000 Subject: [PATCH] Madara: Added Multiple Sources (#1284) Madara: Added Multiple Sources --- src/all/madara/build.gradle | 2 +- .../tachiyomi/extension/all/madara/Madara.kt | 7 ++-- .../extension/all/madara/MadaraFactory.kt | 35 ++++++++++++++++++- 3 files changed, 39 insertions(+), 5 deletions(-) diff --git a/src/all/madara/build.gradle b/src/all/madara/build.gradle index 8c5c3c249..c3d747cb9 100644 --- a/src/all/madara/build.gradle +++ b/src/all/madara/build.gradle @@ -5,7 +5,7 @@ ext { appName = 'Tachiyomi: Madara' pkgNameSuffix = "all.madara" extClass = '.MadaraFactory' - extVersionCode = 3 + extVersionCode = 4 libVersion = '1.2' } diff --git a/src/all/madara/src/eu/kanade/tachiyomi/extension/all/madara/Madara.kt b/src/all/madara/src/eu/kanade/tachiyomi/extension/all/madara/Madara.kt index 15d5fee2e..63d2282ff 100644 --- a/src/all/madara/src/eu/kanade/tachiyomi/extension/all/madara/Madara.kt +++ b/src/all/madara/src/eu/kanade/tachiyomi/extension/all/madara/Madara.kt @@ -62,7 +62,7 @@ open class Madara( return POST("$baseUrl/wp-admin/admin-ajax.php", headers, form.build(), CacheControl.FORCE_NETWORK) } - override fun popularMangaNextPageSelector(): String? = "body:not(:has(.no-posts))" + override fun popularMangaNextPageSelector(): String? = searchMangaNextPageSelector() // Latest Updates @@ -91,7 +91,7 @@ open class Madara( return POST("$baseUrl/wp-admin/admin-ajax.php", headers, form.build(), CacheControl.FORCE_NETWORK) } - override fun latestUpdatesNextPageSelector(): String? = "body:not(:has(.no-posts))" + override fun latestUpdatesNextPageSelector(): String? = searchMangaNextPageSelector() override fun latestUpdatesParse(response: Response): MangasPage { val mp = super.latestUpdatesParse(response) @@ -135,7 +135,7 @@ open class Madara( return manga } - override fun searchMangaNextPageSelector() = popularMangaNextPageSelector() + override fun searchMangaNextPageSelector() = "body:not(:has(.no-posts))" // Manga Details Parse @@ -164,6 +164,7 @@ open class Madara( 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" + "Completed" -> SManga.COMPLETED "OnGoing", "Продолжается", "Updating" -> SManga.ONGOING else -> SManga.UNKNOWN } 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 49a162e29..5dcd10cc4 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 @@ -6,8 +6,13 @@ import eu.kanade.tachiyomi.source.SourceFactory import java.text.SimpleDateFormat import java.util.* import eu.kanade.tachiyomi.network.GET +import eu.kanade.tachiyomi.network.POST import eu.kanade.tachiyomi.source.model.FilterList +import eu.kanade.tachiyomi.source.model.SManga +import okhttp3.CacheControl +import okhttp3.FormBody import okhttp3.Request +import org.jsoup.nodes.Element class MadaraFactory : SourceFactory { override fun createSources(): List = listOf( @@ -25,7 +30,18 @@ class MadaraFactory : SourceFactory { TritiniaScans(), TsubakiNoScan(), YokaiJump(), - ZManga() + ZManga(), + MangazukiMe(), + MangazukiOnline(), + MangazukiClubJP(), + MangazukiClubKO(), + FirstKissManga(), + Mangalike(), + MangaSY(), + ManwhaClub(), + WuxiaWorld(), + YoManga(), + ManyToon() ) } @@ -51,3 +67,20 @@ class TritiniaScans : Madara("Tritinia Scans", "http://tritiniascans.ml/", "en") class TsubakiNoScan : Madara("Tsubaki No Scan", "https://tsubakinoscan.com/", "fr", dateFormat = SimpleDateFormat("dd/MM/yy", Locale.US)) class YokaiJump : Madara("Yokai Jump", "https://yokaijump.fr/", "fr", dateFormat = SimpleDateFormat("dd/MM/yy", Locale.US)) class ZManga : Madara("ZManga", "https://zmanga.org/", "es") +class MangazukiMe : Madara("Mangazuki.me", "https://mangazuki.me/", "en") +class MangazukiOnline : Madara("Mangazuki.online", "https://www.mangazuki.online/", "en") +class MangazukiClubJP : Madara("Mangazuki.club", "https://mangazuki.club/", "ja") +class MangazukiClubKO : Madara("Mangazuki.club", "https://mangazuki.club/", "ko") +class FirstKissManga : Madara("1st Kiss", "https://1stkissmanga.com/", "en") +class Mangalike : Madara("Mangalike", "https://mangalike.net/", "en") +class MangaSY : Madara("Manga SY", "https://www.mangasy.com/", "en") +class ManwhaClub : Madara("Manwha Club", "https://manhwa.club/", "en") +class WuxiaWorld : Madara("WuxiaWorld", "https://wuxiaworld.site/", "en") { + override fun popularMangaRequest(page: Int): Request = GET("$baseUrl/tag/webcomics/page/$page/?m_orderby=views", headers) + override fun latestUpdatesRequest(page: Int): Request = GET("$baseUrl/tag/webcomics/page/$page/?m_orderby=latest", headers) + override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request = GET("$baseUrl/?s=$query&post_type=wp-manga&genre[]=webcomics", headers) + override fun latestUpdatesNextPageSelector(): String? = "div.nav-previous" + override fun popularMangaNextPageSelector(): String? = "div.nav-previous" +} +class YoManga : Madara("Yo Manga", "https://yomanga.info/", "en") +class ManyToon : Madara("ManyToon", "https://manytoon.com/", "en")