From 34ee25aa50a0aa7a117ff56f495c71ba9eb17f07 Mon Sep 17 00:00:00 2001 From: Riztard Lanthorn Date: Mon, 4 Jan 2021 22:05:00 +0700 Subject: [PATCH] Madara fix n replace (#5308) * add arabic for parsing date * make chapter new banner selector to value * fix atikrost chapter name and time issue * fix mangaArabTeam chapter time issue * replace mangaKitsu with mangaCrimson * fix astralLibrary reversed chapter order issue --- src/all/madara/build.gradle | 2 +- .../kanade/tachiyomi/extension/all/madara/Madara.kt | 10 ++++++---- .../tachiyomi/extension/all/madara/MadaraFactory.kt | 12 +++++++----- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/src/all/madara/build.gradle b/src/all/madara/build.gradle index c11cc70e8..20fcf3a84 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 = 163 + extVersionCode = 164 libVersion = '1.2' containsNsfw = true } 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 87383f2de..842f9d9ab 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 @@ -402,6 +402,8 @@ abstract class Madara( open val chapterUrlSuffix = "?style=list" + open val chapterDatesNewSelector = "img" + override fun chapterFromElement(element: Element): SChapter { val chapter = SChapter.create() @@ -414,7 +416,7 @@ abstract class Madara( } // Dates can be part of a "new" graphic or plain text - chapter.date_upload = select("img").firstOrNull()?.attr("alt")?.let { parseRelativeDate(it) } + chapter.date_upload = select(chapterDatesNewSelector).firstOrNull()?.attr("alt")?.let { parseRelativeDate(it) } ?: parseChapterDate(select("span.chapter-release-date i").firstOrNull()?.text()) } @@ -484,9 +486,9 @@ abstract class Madara( val cal = Calendar.getInstance() return when { - WordSet("hari", "gün", "jour", "día", "dia", "day").anyWordIn(date) -> cal.apply { add(Calendar.DAY_OF_MONTH, -number) }.timeInMillis - WordSet("jam", "saat", "heure", "hora", "hour").anyWordIn(date) -> cal.apply { add(Calendar.HOUR, -number) }.timeInMillis - WordSet("menit", "dakika", "min", "minute", "minuto").anyWordIn(date) -> cal.apply { add(Calendar.MINUTE, -number) }.timeInMillis + WordSet("يوم", "hari", "gün", "jour", "día", "dia", "day").anyWordIn(date) -> cal.apply { add(Calendar.DAY_OF_MONTH, -number) }.timeInMillis + WordSet("ساعات", "jam", "saat", "heure", "hora", "hour").anyWordIn(date) -> cal.apply { add(Calendar.HOUR, -number) }.timeInMillis + WordSet("دقيقة", "menit", "dakika", "min", "minute", "minuto").anyWordIn(date) -> cal.apply { add(Calendar.MINUTE, -number) }.timeInMillis WordSet("detik", "segundo", "second").anyWordIn(date) -> cal.apply { add(Calendar.SECOND, -number) }.timeInMillis else -> 0 } 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 998e505c2..9135021f3 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 @@ -101,12 +101,12 @@ class MadaraFactory : SourceFactory { MangaBaz(), MangaBob(), MangaClash(), + MangaCrimson(), MangaCultivator(), MangaDods(), MangaGecesi(), MangaHentai(), MangaKiss(), - MangaKitsu(), MangaKomi(), MangaLandArabic(), Mangalek(), @@ -244,7 +244,10 @@ class SpookyScanlations : Madara("Spooky Scanlations", "https://spookyscanlation class RandomTranslations : Madara("Random Translations", "https://randomtranslations.com", "en", SimpleDateFormat("dd/MM/yyyy", Locale.US)) -class Atikrost : Madara("Atikrost", "https://atikrost.com", "tr", SimpleDateFormat("MMMM dd, yyyy", Locale("tr"))) +class Atikrost : Madara("Atikrost", "https://atikrost.com", "tr", SimpleDateFormat("MMMM dd, yyyy", Locale("tr"))) { + override val chapterUrlSelector = "a:not(:has(img))" + override val chapterDatesNewSelector = "img:not(.thumb)" +} class ManhuaFast : Madara("ManhuaFast", "https://manhuafast.com", "en") { override val pageListParseSelector = "li.blocks-gallery-item" @@ -270,7 +273,7 @@ class Aloalivn : Madara("Aloalivn", "https://aloalivn.com", "en") { class MangaSco : Madara("MangaSco", "https://mangasco.com", "en") -class MangaKitsu : Madara("Manga Kitsu", "https://mangakitsu.com", "tr", SimpleDateFormat("dd MMMM yyyy", Locale("tr"))) +class MangaCrimson : Madara("Manga Crimson", "https://mangacrimson.com", "tr", SimpleDateFormat("dd MMMM yyyy", Locale("tr"))) class PrimeManga : Madara("Prime Manga", "https://primemanga.com", "en") @@ -787,7 +790,7 @@ class HunterFansub : Madara("Hunter Fansub", "https://hunterfansub.com", "es") { class MangaArabOnline : Madara("Manga Arab Online مانجا عرب اون لاين", "https://mangaarabonline.com", "ar", SimpleDateFormat("MMM d, yyyy", Locale.forLanguageTag("ar"))) -class MangaArabTeam : Madara("مانجا عرب تيم Manga Arab Team", "https://mangaarabteam.com", "ar") { +class MangaArabTeam : Madara("مانجا عرب تيم Manga Arab Team", "https://mangaarabteam.com", "ar", SimpleDateFormat("dd MMM، yyyy", Locale.forLanguageTag("ar"))) { override fun imageRequest(page: Page): Request { return GET(page.imageUrl!!.replace("http:", "https:")) } @@ -884,7 +887,6 @@ class GoldenManga : Madara("موقع لترجمة المانجا", "https://gold class Mangalek : Madara("مانجا ليك", "https://mangalek.com", "ar", SimpleDateFormat("MMMM dd, yyyy", Locale("ar"))) 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) }