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
This commit is contained in:
Riztard Lanthorn 2021-01-04 22:05:00 +07:00 committed by GitHub
parent 612f1a16d0
commit 34ee25aa50
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 10 deletions

View File

@ -5,7 +5,7 @@ ext {
extName = 'Madara (multiple sources)'
pkgNameSuffix = "all.madara"
extClass = '.MadaraFactory'
extVersionCode = 163
extVersionCode = 164
libVersion = '1.2'
containsNsfw = true
}

View File

@ -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
}

View File

@ -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<SChapter> = super.chapterListParse(response).reversed()
override fun popularMangaRequest(page: Int): Request {
return GET("$baseUrl/manga-tag/manga/?m_orderby=views&page=$page", headers)
}