Madara - add MangaArabTeam, refactor (#1841)
Madara - add MangaArabTeam, refactor
This commit is contained in:
parent
b27fd2828b
commit
06a99777e7
|
@ -5,7 +5,7 @@ ext {
|
||||||
appName = 'Tachiyomi: Madara (multiple sources)'
|
appName = 'Tachiyomi: Madara (multiple sources)'
|
||||||
pkgNameSuffix = "all.madara"
|
pkgNameSuffix = "all.madara"
|
||||||
extClass = '.MadaraFactory'
|
extClass = '.MadaraFactory'
|
||||||
extVersionCode = 32
|
extVersionCode = 33
|
||||||
libVersion = '1.2'
|
libVersion = '1.2'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -308,7 +308,7 @@ abstract class Madara(
|
||||||
return manga
|
return manga
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun searchMangaNextPageSelector() = "div.nav-previous"
|
override fun searchMangaNextPageSelector() = "div.nav-previous, nav.navigation-ajax"
|
||||||
|
|
||||||
// Manga Details Parse
|
// Manga Details Parse
|
||||||
|
|
||||||
|
@ -371,8 +371,9 @@ abstract class Madara(
|
||||||
}
|
}
|
||||||
|
|
||||||
// For when source's chapter date is a graphic representing "new" instead of text
|
// For when source's chapter date is a graphic representing "new" instead of text
|
||||||
if (select("img").attr("alt").isNotBlank()) {
|
val imgDate = select("img").attr("alt")
|
||||||
chapter.date_upload = parseRelativeDate(select("img").attr("alt")) ?: 0
|
if (imgDate.isNotBlank()) {
|
||||||
|
chapter.date_upload = parseRelativeDate(imgDate)
|
||||||
} else {
|
} else {
|
||||||
// For a chapter date that's text
|
// For a chapter date that's text
|
||||||
select("span.chapter-release-date i").first()?.let {
|
select("span.chapter-release-date i").first()?.let {
|
||||||
|
@ -387,7 +388,7 @@ abstract class Madara(
|
||||||
open fun parseChapterDate(date: String): Long? {
|
open fun parseChapterDate(date: String): Long? {
|
||||||
val lcDate = date.toLowerCase()
|
val lcDate = date.toLowerCase()
|
||||||
if (lcDate.endsWith(" ago"))
|
if (lcDate.endsWith(" ago"))
|
||||||
parseRelativeDate(lcDate)?.let { return it }
|
return parseRelativeDate(lcDate)
|
||||||
|
|
||||||
//Handle 'yesterday' and 'today', using midnight
|
//Handle 'yesterday' and 'today', using midnight
|
||||||
if (lcDate.startsWith("year"))
|
if (lcDate.startsWith("year"))
|
||||||
|
@ -411,21 +412,27 @@ abstract class Madara(
|
||||||
|
|
||||||
// Parses dates in this form:
|
// Parses dates in this form:
|
||||||
// 21 horas ago
|
// 21 horas ago
|
||||||
private fun parseRelativeDate(date: String): Long? {
|
private fun parseRelativeDate(date: String): Long {
|
||||||
val trimmedDate = date.split(" ")
|
val trimmedDate = date.split(" ")
|
||||||
if (trimmedDate[2] != "ago") return null
|
val number = trimmedDate[0].toIntOrNull()
|
||||||
val number = trimmedDate[0].toIntOrNull() ?: return null
|
|
||||||
|
|
||||||
// Map English and other language units to Java units
|
/**
|
||||||
val javaUnit = when (trimmedDate[1].removeSuffix("s")) {
|
* Size check is for Arabic language, would sometimes break if we don't check
|
||||||
"jour", "día", "day" -> Calendar.DAY_OF_MONTH
|
* Take that in to consideration if adding support for parsing Arabic dates
|
||||||
"heure", "hora", "hour" -> Calendar.HOUR
|
*/
|
||||||
"min", "minute" -> Calendar.MINUTE
|
return if (trimmedDate.size == 3 && trimmedDate[2] == "ago" && number is Int) {
|
||||||
"segundo", "second" -> Calendar.SECOND
|
val cal = Calendar.getInstance()
|
||||||
else -> return null
|
// Map English and other language units to Java units
|
||||||
|
when (trimmedDate[1].removeSuffix("s")) {
|
||||||
|
"jour", "día", "day" -> cal.apply { add(Calendar.DAY_OF_MONTH, -number) }.timeInMillis
|
||||||
|
"heure", "hora", "hour" -> cal.apply { add(Calendar.HOUR, -number) }.timeInMillis
|
||||||
|
"min", "minute" -> cal.apply { add(Calendar.MINUTE, -number) }.timeInMillis
|
||||||
|
"segundo", "second" -> cal.apply { add(Calendar.SECOND, -number) }.timeInMillis
|
||||||
|
else -> 0
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
0
|
||||||
}
|
}
|
||||||
|
|
||||||
return Calendar.getInstance().apply { add(javaUnit, -number) }.timeInMillis
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun SimpleDateFormat.parseOrNull(string: String): Date? {
|
private fun SimpleDateFormat.parseOrNull(string: String): Date? {
|
||||||
|
|
|
@ -59,27 +59,22 @@ class MadaraFactory : SourceFactory {
|
||||||
Hiperdex(),
|
Hiperdex(),
|
||||||
DoujinHentai(),
|
DoujinHentai(),
|
||||||
Azora(),
|
Azora(),
|
||||||
HunterFansub()
|
HunterFansub(),
|
||||||
|
MangaArabTeam()
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
class Mangasushi : Madara("Mangasushi", "https://mangasushi.net", "en") {
|
class Mangasushi : Madara("Mangasushi", "https://mangasushi.net", "en")
|
||||||
override fun searchMangaNextPageSelector() = "nav.navigation-ajax"
|
|
||||||
}
|
|
||||||
|
|
||||||
class NinjaScans : Madara("NinjaScans", "https://ninjascans.com", "en")
|
class NinjaScans : Madara("NinjaScans", "https://ninjascans.com", "en")
|
||||||
class ReadManhua : Madara("ReadManhua", "https://readmanhua.net", "en",
|
class ReadManhua : Madara("ReadManhua", "https://readmanhua.net", "en",
|
||||||
dateFormat = SimpleDateFormat("dd MMM yy", Locale.US)) {
|
dateFormat = SimpleDateFormat("dd MMM yy", Locale.US))
|
||||||
override fun searchMangaNextPageSelector() = "nav.navigation-ajax"
|
|
||||||
}
|
|
||||||
|
|
||||||
class ZeroScans : Madara("ZeroScans", "https://zeroscans.com", "en")
|
class ZeroScans : Madara("ZeroScans", "https://zeroscans.com", "en")
|
||||||
class IsekaiScanCom : Madara("IsekaiScan.com", "https://isekaiscan.com/", "en")
|
class IsekaiScanCom : Madara("IsekaiScan.com", "https://isekaiscan.com/", "en")
|
||||||
class HappyTeaScans : Madara("Happy Tea Scans", "https://happyteascans.com/", "en")
|
class HappyTeaScans : Madara("Happy Tea Scans", "https://happyteascans.com/", "en")
|
||||||
class JustForFun : Madara("Just For Fun", "https://just-for-fun.ru/", "ru",
|
class JustForFun : Madara("Just For Fun", "https://just-for-fun.ru/", "ru",
|
||||||
dateFormat = SimpleDateFormat("dd/MM/yy", Locale.US)) {
|
dateFormat = SimpleDateFormat("dd/MM/yy", Locale.US))
|
||||||
override fun searchMangaNextPageSelector() = "nav.navigation-ajax"
|
|
||||||
}
|
|
||||||
|
|
||||||
class AoCTranslations : Madara("Agent of Change Translations", "https://aoc.moe/", "en") {
|
class AoCTranslations : Madara("Agent of Change Translations", "https://aoc.moe/", "en") {
|
||||||
override fun chapterListParse(response: Response): List<SChapter> {
|
override fun chapterListParse(response: Response): List<SChapter> {
|
||||||
|
@ -113,11 +108,10 @@ class AoCTranslations : Madara("Agent of Change Translations", "https://aoc.moe/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class KomikGo : Madara("KomikGo", "https://komikgo.com", "id") {
|
class KomikGo : Madara("KomikGo", "https://komikgo.com", "id")
|
||||||
override fun searchMangaNextPageSelector() = "nav.navigation-ajax"
|
|
||||||
}
|
|
||||||
|
|
||||||
class LuxyScans : Madara("Luxy Scans", "https://luxyscans.com/", "en")
|
class LuxyScans : Madara("Luxy Scans", "https://luxyscans.com/", "en")
|
||||||
|
|
||||||
class TritiniaScans : Madara("Tritinia Scans", "http://ghajik.ml/", "en",
|
class TritiniaScans : Madara("Tritinia Scans", "http://ghajik.ml/", "en",
|
||||||
dateFormat = SimpleDateFormat("dd/MM/yy", Locale.US)) {
|
dateFormat = SimpleDateFormat("dd/MM/yy", Locale.US)) {
|
||||||
override fun popularMangaRequest(page: Int): Request = GET("$baseUrl/?m_orderby=views", headers)
|
override fun popularMangaRequest(page: Int): Request = GET("$baseUrl/?m_orderby=views", headers)
|
||||||
|
@ -130,30 +124,20 @@ class TsubakiNoScan : Madara("Tsubaki No Scan", "https://tsubakinoscan.com/",
|
||||||
"fr", dateFormat = SimpleDateFormat("dd/MM/yy", Locale.US))
|
"fr", dateFormat = SimpleDateFormat("dd/MM/yy", Locale.US))
|
||||||
|
|
||||||
class YokaiJump : Madara("Yokai Jump", "https://yokaijump.fr/", "fr",
|
class YokaiJump : Madara("Yokai Jump", "https://yokaijump.fr/", "fr",
|
||||||
dateFormat = SimpleDateFormat("dd/MM/yy", Locale.US)) {
|
dateFormat = SimpleDateFormat("dd/MM/yy", Locale.US))
|
||||||
override fun searchMangaNextPageSelector() = "nav.navigation-ajax"
|
|
||||||
}
|
|
||||||
|
|
||||||
class ZManga : Madara("ZManga", "https://zmanga.org/", "es") {
|
class ZManga : Madara("ZManga", "https://zmanga.org/", "es")
|
||||||
override fun searchMangaNextPageSelector() = "nav.navigation-ajax"
|
|
||||||
}
|
|
||||||
|
|
||||||
class MangazukiMe : Madara("Mangazuki.me", "https://mangazuki.me/", "en")
|
class MangazukiMe : Madara("Mangazuki.me", "https://mangazuki.me/", "en")
|
||||||
class MangazukiOnline : Madara("Mangazuki.online", "https://www.mangazuki.online/", "en") {
|
|
||||||
override fun searchMangaNextPageSelector() = "nav.navigation-ajax"
|
|
||||||
}
|
|
||||||
|
|
||||||
class MangazukiClubJP : Madara("Mangazuki.club", "https://mangazuki.club/", "ja") {
|
class MangazukiOnline : Madara("Mangazuki.online", "https://www.mangazuki.online/", "en")
|
||||||
override fun searchMangaNextPageSelector() = "nav.navigation-ajax"
|
|
||||||
}
|
|
||||||
|
|
||||||
class MangazukiClubKO : Madara("Mangazuki.club", "https://mangazuki.club/", "ko") {
|
class MangazukiClubJP : Madara("Mangazuki.club", "https://mangazuki.club/", "ja")
|
||||||
override fun searchMangaNextPageSelector() = "nav.navigation-ajax"
|
|
||||||
}
|
class MangazukiClubKO : Madara("Mangazuki.club", "https://mangazuki.club/", "ko")
|
||||||
|
|
||||||
class FirstKissManga : Madara("1st Kiss", "https://1stkissmanga.com/", "en") {
|
class FirstKissManga : Madara("1st Kiss", "https://1stkissmanga.com/", "en") {
|
||||||
override val pageListParseSelector = "div.reading-content img"
|
override val pageListParseSelector = "div.reading-content img"
|
||||||
override fun searchMangaNextPageSelector() = "nav.navigation-ajax"
|
|
||||||
private val cdnUrl = "cdn.1stkissmanga.com"
|
private val cdnUrl = "cdn.1stkissmanga.com"
|
||||||
override fun imageRequest(page: Page): Request {
|
override fun imageRequest(page: Page): Request {
|
||||||
val cdnHeaders = Headers.Builder().apply {
|
val cdnHeaders = Headers.Builder().apply {
|
||||||
|
@ -164,11 +148,10 @@ class FirstKissManga : Madara("1st Kiss", "https://1stkissmanga.com/", "en") {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class MangaSY : Madara("Manga SY", "https://www.mangasy.com/", "en") {
|
class MangaSY : Madara("Manga SY", "https://www.mangasy.com/", "en")
|
||||||
override fun searchMangaNextPageSelector() = "nav.navigation-ajax"
|
|
||||||
}
|
|
||||||
|
|
||||||
class ManwhaClub : Madara("Manwha Club", "https://manhwa.club/", "en")
|
class ManwhaClub : Madara("Manwha Club", "https://manhwa.club/", "en")
|
||||||
|
|
||||||
class WuxiaWorld : Madara("WuxiaWorld", "https://wuxiaworld.site/", "en") {
|
class WuxiaWorld : Madara("WuxiaWorld", "https://wuxiaworld.site/", "en") {
|
||||||
override fun popularMangaRequest(page: Int): Request = GET("$baseUrl/tag/webcomic/page/$page/?m_orderby=views", headers)
|
override fun popularMangaRequest(page: Int): Request = GET("$baseUrl/tag/webcomic/page/$page/?m_orderby=views", headers)
|
||||||
override fun latestUpdatesRequest(page: Int): Request = GET("$baseUrl/tag/webcomic/page/$page/?m_orderby=latest", headers)
|
override fun latestUpdatesRequest(page: Int): Request = GET("$baseUrl/tag/webcomic/page/$page/?m_orderby=latest", headers)
|
||||||
|
@ -190,33 +173,22 @@ class WordRain : Madara("WordRain Translation", "https://wordrain69.com", "en")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class YoManga : Madara("Yo Manga", "https://yomanga.info/", "en") {
|
class YoManga : Madara("Yo Manga", "https://yomanga.info/", "en")
|
||||||
override fun searchMangaNextPageSelector() = "nav.navigation-ajax"
|
|
||||||
}
|
|
||||||
|
|
||||||
class ManyToon : Madara("ManyToon", "https://manytoon.com/", "en") {
|
class ManyToon : Madara("ManyToon", "https://manytoon.com/", "en")
|
||||||
override fun searchMangaNextPageSelector() = "nav.navigation-ajax"
|
|
||||||
}
|
|
||||||
|
|
||||||
class ChibiManga : Madara("Chibi Manga", "http://www.cmreader.info/", "en") {
|
class ChibiManga : Madara("Chibi Manga", "http://www.cmreader.info/", "en")
|
||||||
override fun searchMangaNextPageSelector() = "nav.navigation-ajax"
|
|
||||||
}
|
|
||||||
|
|
||||||
class ZinManga : Madara("Zin Translator", "https://zinmanga.com/", "en") {
|
class ZinManga : Madara("Zin Translator", "https://zinmanga.com/", "en") {
|
||||||
override fun headersBuilder(): Headers.Builder = super.headersBuilder()
|
override fun headersBuilder(): Headers.Builder = super.headersBuilder()
|
||||||
.add("Referer", "https://zinmanga.com/")
|
.add("Referer", "https://zinmanga.com/")
|
||||||
override fun searchMangaNextPageSelector() = "nav.navigation-ajax"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class ManwahentaiMe : Madara("Manwahentai.me", "https://manhwahentai.me", "en")
|
class ManwahentaiMe : Madara("Manwahentai.me", "https://manhwahentai.me", "en")
|
||||||
|
|
||||||
class Manga3asq : Madara("مانجا العاشق", "https://3asq.org", "ar") {
|
class Manga3asq : Madara("مانجا العاشق", "https://3asq.org", "ar")
|
||||||
override fun searchMangaNextPageSelector() = "nav.navigation-ajax"
|
|
||||||
}
|
|
||||||
|
|
||||||
class NManhwa : Madara("N Manhwa", "https://nmanhwa.com", "en") {
|
class NManhwa : Madara("N Manhwa", "https://nmanhwa.com", "en")
|
||||||
override fun searchMangaNextPageSelector() = "nav.navigation-ajax"
|
|
||||||
}
|
|
||||||
|
|
||||||
class Indiancomicsonline : Madara("Indian Comics Online", "http://www.indiancomicsonline.com", "hi")
|
class Indiancomicsonline : Madara("Indian Comics Online", "http://www.indiancomicsonline.com", "hi")
|
||||||
|
|
||||||
|
@ -224,9 +196,9 @@ class AdonisFansub : Madara("Adonis Fansub", "https://manga.adonisfansub.com", "
|
||||||
override fun popularMangaRequest(page: Int): Request = GET("$baseUrl/manga/page/$page/?m_orderby=views", headers)
|
override fun popularMangaRequest(page: Int): Request = GET("$baseUrl/manga/page/$page/?m_orderby=views", headers)
|
||||||
override fun latestUpdatesRequest(page: Int): Request = GET("$baseUrl/manga/page/$page/?m_orderby=latest", headers)
|
override fun latestUpdatesRequest(page: Int): Request = GET("$baseUrl/manga/page/$page/?m_orderby=latest", headers)
|
||||||
}
|
}
|
||||||
class GetManhwa : Madara("GetManhwa", "https://getmanhwa.co", "en") {
|
|
||||||
override fun searchMangaNextPageSelector() = "nav.navigation-ajax"
|
class GetManhwa : Madara("GetManhwa", "https://getmanhwa.co", "en")
|
||||||
}
|
|
||||||
class AllPornComic : Madara("AllPornComic", "https://allporncomic.com", "en") {
|
class AllPornComic : Madara("AllPornComic", "https://allporncomic.com", "en") {
|
||||||
override fun searchMangaNextPageSelector() = "a[rel=next]"
|
override fun searchMangaNextPageSelector() = "a[rel=next]"
|
||||||
override fun getGenreList() = listOf(
|
override fun getGenreList() = listOf(
|
||||||
|
@ -235,6 +207,7 @@ class AllPornComic : Madara("AllPornComic", "https://allporncomic.com", "en") {
|
||||||
Genre("Western", "western")
|
Genre("Western", "western")
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
class Milftoon : Madara("Milftoon", "https://milftoon.xxx", "en") {
|
class Milftoon : Madara("Milftoon", "https://milftoon.xxx", "en") {
|
||||||
override fun popularMangaRequest(page: Int): Request = GET("$baseUrl/page/$page/?m_orderby=views", headers)
|
override fun popularMangaRequest(page: Int): Request = GET("$baseUrl/page/$page/?m_orderby=views", headers)
|
||||||
override fun latestUpdatesRequest(page: Int): Request = GET("$baseUrl/page/$page/?m_orderby=latest", headers)
|
override fun latestUpdatesRequest(page: Int): Request = GET("$baseUrl/page/$page/?m_orderby=latest", headers)
|
||||||
|
@ -368,7 +341,6 @@ class DoujinHentai : Madara("DoujinHentai", "https://doujinhentai.net", "es", Si
|
||||||
|
|
||||||
class Azora : Madara("Azora", "https://www.azoramanga.com", "ar") {
|
class Azora : Madara("Azora", "https://www.azoramanga.com", "ar") {
|
||||||
override fun popularMangaRequest(page: Int): Request = GET("$baseUrl/page/$page/?m_orderby=views", headers)
|
override fun popularMangaRequest(page: Int): Request = GET("$baseUrl/page/$page/?m_orderby=views", headers)
|
||||||
override fun searchMangaNextPageSelector() = "nav.navigation-ajax"
|
|
||||||
override fun chapterListSelector() = "li.wp-manga-chapter:not(:has(img))" // Filter fake chapters
|
override fun chapterListSelector() = "li.wp-manga-chapter:not(:has(img))" // Filter fake chapters
|
||||||
override fun chapterFromElement(element: Element): SChapter {
|
override fun chapterFromElement(element: Element): SChapter {
|
||||||
val chapter = SChapter.create()
|
val chapter = SChapter.create()
|
||||||
|
@ -386,3 +358,5 @@ class HunterFansub : Madara("Hunter Fansub", "https://hunterfansub.com", "es") {
|
||||||
override fun popularMangaNextPageSelector() = "div.nav-previous"
|
override fun popularMangaNextPageSelector() = "div.nav-previous"
|
||||||
override val popularMangaUrlSelector = "div.post-title a:last-child"
|
override val popularMangaUrlSelector = "div.post-title a:last-child"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class MangaArabTeam : Madara("مانجا عرب تيم Manga Arab Team", "https://mangaarabteam.com", "ar")
|
||||||
|
|
Loading…
Reference in New Issue