Merge YM into a multilang ext. (#10501)
This commit is contained in:
parent
b4a54ccbfb
commit
3782a58f30
|
@ -0,0 +1,56 @@
|
||||||
|
package eu.kanade.tachiyomi.extension.all.yugenmangas
|
||||||
|
|
||||||
|
import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor
|
||||||
|
import eu.kanade.tachiyomi.multisrc.madara.Madara
|
||||||
|
import eu.kanade.tachiyomi.source.SourceFactory
|
||||||
|
import eu.kanade.tachiyomi.source.model.SChapter
|
||||||
|
import okhttp3.OkHttpClient
|
||||||
|
import org.jsoup.nodes.Element
|
||||||
|
import java.text.SimpleDateFormat
|
||||||
|
import java.util.Locale
|
||||||
|
import java.util.concurrent.TimeUnit
|
||||||
|
|
||||||
|
class YugenMangasFactory : SourceFactory {
|
||||||
|
override fun createSources() = listOf(
|
||||||
|
YugenMangasEs(),
|
||||||
|
YugenMangasBr()
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
abstract class YugenMangas(
|
||||||
|
override val baseUrl: String,
|
||||||
|
override val lang: String,
|
||||||
|
dateFormat: SimpleDateFormat = SimpleDateFormat("MMMMM dd, yyyy", Locale.US)
|
||||||
|
) : Madara("YugenMangas", baseUrl, lang, dateFormat) {
|
||||||
|
|
||||||
|
override fun popularMangaSelector() = "div.page-item-detail.manga"
|
||||||
|
|
||||||
|
override fun chapterFromElement(element: Element): SChapter = SChapter.create().apply {
|
||||||
|
name = element.selectFirst("a")!!.ownText()
|
||||||
|
date_upload = parseChapterDate(element.selectFirst("span.chapter-release-date i")?.text())
|
||||||
|
|
||||||
|
val chapterUrl = element.selectFirst("a")!!.attr("abs:href")
|
||||||
|
setUrlWithoutDomain(
|
||||||
|
chapterUrl.substringBefore("?style=paged") +
|
||||||
|
if (!chapterUrl.endsWith(chapterUrlSuffix)) chapterUrlSuffix else ""
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class YugenMangasEs : YugenMangas("https://yugenmangas.com", "es")
|
||||||
|
|
||||||
|
class YugenMangasBr : YugenMangas(
|
||||||
|
"https://yugenmangas.com.br",
|
||||||
|
"pt-BR",
|
||||||
|
SimpleDateFormat("MMMMM dd, yyyy", Locale("pt", "BR"))
|
||||||
|
) {
|
||||||
|
|
||||||
|
override val client: OkHttpClient = super.client.newBuilder()
|
||||||
|
.addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS))
|
||||||
|
.build()
|
||||||
|
|
||||||
|
override val altName: String = "Nome alternativo: "
|
||||||
|
|
||||||
|
override val useNewChapterEndpoint: Boolean = true
|
||||||
|
}
|
||||||
|
|
|
@ -17,6 +17,7 @@ class MadaraGenerator : ThemeSourceGenerator {
|
||||||
MultiLang("MangaForFree.net", "https://mangaforfree.net", listOf("en", "ko", "all"), isNsfw = true, className = "MangaForFreeFactory", pkgName = "mangaforfree", overrideVersionCode = 1),
|
MultiLang("MangaForFree.net", "https://mangaforfree.net", listOf("en", "ko", "all"), isNsfw = true, className = "MangaForFreeFactory", pkgName = "mangaforfree", overrideVersionCode = 1),
|
||||||
MultiLang("Manhwa18.cc", "https://manhwa18.cc", listOf("en", "ko", "all"), isNsfw = true, className = "Manhwa18CcFactory", pkgName = "manhwa18cc", overrideVersionCode = 1),
|
MultiLang("Manhwa18.cc", "https://manhwa18.cc", listOf("en", "ko", "all"), isNsfw = true, className = "Manhwa18CcFactory", pkgName = "manhwa18cc", overrideVersionCode = 1),
|
||||||
MultiLang("Reaper Scans", "https://reaperscans.com", listOf("en", "pt-BR"), className = "ReaperScansFactory", pkgName = "reaperscans", overrideVersionCode = 3),
|
MultiLang("Reaper Scans", "https://reaperscans.com", listOf("en", "pt-BR"), className = "ReaperScansFactory", pkgName = "reaperscans", overrideVersionCode = 3),
|
||||||
|
MultiLang("YugenMangas", "https://yugenmangas.com", listOf("es", "pt-BR")),
|
||||||
SingleLang("1st Kiss Manga.love", "https://1stkissmanga.love", "en", className = "FirstKissMangaLove"),
|
SingleLang("1st Kiss Manga.love", "https://1stkissmanga.love", "en", className = "FirstKissMangaLove"),
|
||||||
SingleLang("1st Kiss Manhua", "https://1stkissmanhua.com", "en", className = "FirstKissManhua", overrideVersionCode = 2),
|
SingleLang("1st Kiss Manhua", "https://1stkissmanhua.com", "en", className = "FirstKissManhua", overrideVersionCode = 2),
|
||||||
SingleLang("1st Kiss", "https://1stkissmanga.io", "en", className = "FirstKissManga", pkgName = "firstkissmanga", overrideVersionCode = 6),
|
SingleLang("1st Kiss", "https://1stkissmanga.io", "en", className = "FirstKissManga", pkgName = "firstkissmanga", overrideVersionCode = 6),
|
||||||
|
@ -431,7 +432,6 @@ class MadaraGenerator : ThemeSourceGenerator {
|
||||||
SingleLang("Yaoi.mobi", "https://yaoi.mobi", "en", isNsfw = true, className = "YaoiManga", pkgName = "yaoimanga", overrideVersionCode = 4),
|
SingleLang("Yaoi.mobi", "https://yaoi.mobi", "en", isNsfw = true, className = "YaoiManga", pkgName = "yaoimanga", overrideVersionCode = 4),
|
||||||
SingleLang("YaoiScan", "https://yaoiscan.com", "en", isNsfw = true),
|
SingleLang("YaoiScan", "https://yaoiscan.com", "en", isNsfw = true),
|
||||||
SingleLang("YaoiToon", "https://yaoitoon.com", "en", isNsfw = true),
|
SingleLang("YaoiToon", "https://yaoitoon.com", "en", isNsfw = true),
|
||||||
SingleLang("YugenMangas", "https://yugenmangas.com", "es", overrideVersionCode = 3),
|
|
||||||
SingleLang("Yuri Verso", "https://yuri.live", "pt-BR", overrideVersionCode = 3),
|
SingleLang("Yuri Verso", "https://yuri.live", "pt-BR", overrideVersionCode = 3),
|
||||||
SingleLang("Zinmanga", "https://zinmanga.com", "en"),
|
SingleLang("Zinmanga", "https://zinmanga.com", "en"),
|
||||||
SingleLang("Zinmanhwa", "https://zinmanhwa.com", "en"),
|
SingleLang("Zinmanhwa", "https://zinmanhwa.com", "en"),
|
||||||
|
|
Loading…
Reference in New Issue