Fix Mangauptocat and Rh2PlusManga Chapter date parser (#9501)

* Add MikuDoujin
* Add MikuDoujin V.1.2.1

* Update MikuDoujin.kt

* Update MikuDoujin
* Add ability to search using genre

* Add Rh2PlusManga
* Add Rh2PlusManga V.1.12.2
* Use Madara multi-source themes

* Change MikuDoujin gradle and Add Rh2PlusManga generator.
* update file to suggestion.
* add Rh2PlusManga to MadaraGenerator.kt.

* Fix Thai Madara source time format and MikuDoujin pages selector.
* add Thai relative time wordlist to Madara parseRelativeDate.
* change Rh2PlusManga and Mangauptocat date format.
* change Mangauptocat base url.
* change MikuDoujin pageListParse selector.
This commit is contained in:
Promchai Chooseang 2021-10-18 16:14:52 +07:00 committed by GitHub
parent 17f0fa1889
commit e9626ac74e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 15 additions and 11 deletions

View File

@ -4,7 +4,12 @@ import eu.kanade.tachiyomi.multisrc.madara.Madara
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.Locale import java.util.Locale
class Mangauptocats : Madara("Mangauptocats", "https://mangauptocats.online", "th", SimpleDateFormat("MMMM d, yyyy", Locale("th"))) { class Mangauptocats : Madara(
"Mangauptocats",
"https://mangauptocats.net",
"th",
SimpleDateFormat("d MMMM yyyy", Locale("th"))
) {
override fun getGenreList() = listOf( override fun getGenreList() = listOf(
Genre("Mecha", "mecha"), Genre("Mecha", "mecha"),
Genre("Mystery", "mystery"), Genre("Mystery", "mystery"),

View File

@ -6,7 +6,7 @@ import org.jsoup.nodes.Document
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.Locale import java.util.Locale
class Rh2PlusManga : Madara("Rh2PlusManga", "https://www.rh2plusmanga.com", "th", SimpleDateFormat("d MMMM d yyyy", Locale("th"))) { class Rh2PlusManga : Madara("Rh2PlusManga", "https://www.rh2plusmanga.com", "th", SimpleDateFormat("d MMMM yyyy", Locale("th"))) {
override val useNewChapterEndpoint = true override val useNewChapterEndpoint = true
override fun getGenreList() = listOf( override fun getGenreList() = listOf(
Genre("เหนือธรรมชาติ", "supernatural"), Genre("เหนือธรรมชาติ", "supernatural"),

View File

@ -547,10 +547,10 @@ abstract class Madara(
val cal = Calendar.getInstance() val cal = Calendar.getInstance()
return when { return when {
WordSet("hari", "gün", "jour", "día", "dia", "day").anyWordIn(date) -> cal.apply { add(Calendar.DAY_OF_MONTH, -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("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("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 WordSet("detik", "segundo", "second", "วินาที").anyWordIn(date) -> cal.apply { add(Calendar.SECOND, -number) }.timeInMillis
WordSet("month").anyWordIn(date) -> cal.apply { add(Calendar.MONTH, -number) }.timeInMillis WordSet("month").anyWordIn(date) -> cal.apply { add(Calendar.MONTH, -number) }.timeInMillis
WordSet("year").anyWordIn(date) -> cal.apply { add(Calendar.YEAR, -number) }.timeInMillis WordSet("year").anyWordIn(date) -> cal.apply { add(Calendar.YEAR, -number) }.timeInMillis
else -> 0 else -> 0

View File

@ -242,7 +242,7 @@ class MadaraGenerator : ThemeSourceGenerator {
SingleLang("Mangakik", "https://mangakik.com", "en"), SingleLang("Mangakik", "https://mangakik.com", "en"),
SingleLang("Mangas Origines", "https://mangas-origines.fr", "fr", true, overrideVersionCode = 2), SingleLang("Mangas Origines", "https://mangas-origines.fr", "fr", true, overrideVersionCode = 2),
SingleLang("Mangasushi", "https://mangasushi.net", "en", overrideVersionCode = 2), SingleLang("Mangasushi", "https://mangasushi.net", "en", overrideVersionCode = 2),
SingleLang("Mangauptocats", "https://mangauptocats.online", "th", overrideVersionCode = 1), SingleLang("Mangauptocats", "https://mangauptocats.online", "th", overrideVersionCode = 2),
SingleLang("Mangazuki.me", "https://mangazuki.me", "en", className = "MangazukiMe", overrideVersionCode = 1), SingleLang("Mangazuki.me", "https://mangazuki.me", "en", className = "MangazukiMe", overrideVersionCode = 1),
SingleLang("Mangceh", "https://mangceh.me", "id", isNsfw = true, overrideVersionCode = 3), SingleLang("Mangceh", "https://mangceh.me", "id", isNsfw = true, overrideVersionCode = 3),
SingleLang("Manhua Dragon", "https://manhuadragon.com", "en"), SingleLang("Manhua Dragon", "https://manhuadragon.com", "en"),
@ -335,7 +335,7 @@ class MadaraGenerator : ThemeSourceGenerator {
SingleLang("Red Ribbon Scanlator", "https://redribbon.site", "pt-BR", overrideVersionCode = 1), SingleLang("Red Ribbon Scanlator", "https://redribbon.site", "pt-BR", overrideVersionCode = 1),
SingleLang("Renascence Scans (Renascans)", "https://new.renascans.com", "en", className = "RenaScans", overrideVersionCode = 1), SingleLang("Renascence Scans (Renascans)", "https://new.renascans.com", "en", className = "RenaScans", overrideVersionCode = 1),
SingleLang("Reset Scans", "https://reset-scans.com", "en", overrideVersionCode = 4), SingleLang("Reset Scans", "https://reset-scans.com", "en", overrideVersionCode = 4),
SingleLang("Rh2PlusManga", "https://www.rh2plusmanga.com", "th", overrideVersionCode = 1), SingleLang("Rh2PlusManga", "https://www.rh2plusmanga.com", "th", overrideVersionCode = 2),
SingleLang("Rüya Manga", "https://www.ruyamanga.com", "tr", className = "RuyaManga", overrideVersionCode = 1), SingleLang("Rüya Manga", "https://www.ruyamanga.com", "tr", className = "RuyaManga", overrideVersionCode = 1),
SingleLang("S2Manga", "https://s2manga.com", "en", overrideVersionCode = 1), SingleLang("S2Manga", "https://s2manga.com", "en", overrideVersionCode = 1),
SingleLang("SISI GELAP", "https://sigel.xyz", "id", overrideVersionCode = 3), SingleLang("SISI GELAP", "https://sigel.xyz", "id", overrideVersionCode = 3),

View File

@ -5,7 +5,7 @@ ext {
extName = 'MikuDoujin' extName = 'MikuDoujin'
pkgNameSuffix = 'th.mikudoujin' pkgNameSuffix = 'th.mikudoujin'
extClass = '.MikuDoujin' extClass = '.MikuDoujin'
extVersionCode = 1 extVersionCode = 2
isNsfw = true isNsfw = true
} }

View File

@ -185,8 +185,7 @@ class MikuDoujin : ParsedHttpSource() {
// Pages // Pages
override fun pageListParse(document: Document): List<Page> { override fun pageListParse(document: Document): List<Page> {
val pageList = document.select("img.lazy") return document.select("div#v-pills-tabContent img.lazy").mapIndexed { i, img ->
return pageList.subList(0, (pageList.size / 2) - 1).mapIndexed { i, img ->
Page(i, "", img.attr("abs:data-src")) Page(i, "", img.attr("abs:data-src"))
} }
} }