Update ReaperScans (#9939)
* Update ReaperScans * Update ReaperScansFactory.kt * Split En and Br * Add DateFormat support for Br * Remove legacy code
This commit is contained in:
parent
cd7fc67815
commit
c180e86148
|
@ -6,6 +6,8 @@ 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 ReaperScansFactory : SourceFactory {
|
||||
|
@ -17,8 +19,9 @@ class ReaperScansFactory : SourceFactory {
|
|||
|
||||
abstract class ReaperScans(
|
||||
override val baseUrl: String,
|
||||
override val lang: String
|
||||
) : Madara("Reaper Scans", baseUrl, lang) {
|
||||
override val lang: String,
|
||||
dateFormat: SimpleDateFormat = SimpleDateFormat("MMMM dd, yyyy", Locale.US)
|
||||
) : Madara("Reaper Scans", baseUrl, lang, dateFormat) {
|
||||
|
||||
override fun popularMangaSelector() = "div.page-item-detail.manga"
|
||||
|
||||
|
@ -30,13 +33,9 @@ abstract class ReaperScans(
|
|||
chapter.url = urlElement.attr("abs:href").let {
|
||||
it.substringBefore("?style=paged") + if (!it.endsWith(chapterUrlSuffix)) chapterUrlSuffix else ""
|
||||
}
|
||||
chapter.name = urlElement.ownText()
|
||||
chapter.name = urlElement.select("p.chapter-manhwa-title").firstOrNull()?.ownText().toString()
|
||||
}
|
||||
// Dates can be part of a "new" graphic or plain text
|
||||
// Added "title" alternative
|
||||
chapter.date_upload = select("img").firstOrNull()?.attr("alt")?.let { parseRelativeDate(it) }
|
||||
?: select("span a").firstOrNull()?.attr("title")?.let { parseRelativeDate(it) }
|
||||
?: parseChapterDate(select("span.chapter-release-date i").firstOrNull()?.text())
|
||||
chapter.date_upload = select("span.chapter-release-date i").firstOrNull()?.text().let { parseChapterDate(it) }
|
||||
}
|
||||
|
||||
return chapter
|
||||
|
@ -47,7 +46,7 @@ class ReaperScansEn : ReaperScans("https://reaperscans.com", "en") {
|
|||
override val versionId = 2
|
||||
}
|
||||
|
||||
class ReaperScansBr : ReaperScans("https://reaperscans.com.br", "pt-BR") {
|
||||
class ReaperScansBr : ReaperScans("https://reaperscans.com.br", "pt-BR", SimpleDateFormat("dd/MM/yyyy", Locale.US)) {
|
||||
override val id = 7767018058145795388
|
||||
|
||||
override val client: OkHttpClient = super.client.newBuilder()
|
||||
|
@ -55,4 +54,18 @@ class ReaperScansBr : ReaperScans("https://reaperscans.com.br", "pt-BR") {
|
|||
.build()
|
||||
|
||||
override val altName: String = "Nome alternativo: "
|
||||
|
||||
override fun chapterFromElement(element: Element): SChapter {
|
||||
val chapter = SChapter.create()
|
||||
with(element) {
|
||||
select(chapterUrlSelector).first()?.let { urlElement ->
|
||||
chapter.url = urlElement.attr("abs:href").let {
|
||||
it.substringBefore("?style=paged") + if (!it.endsWith(chapterUrlSuffix)) chapterUrlSuffix else ""
|
||||
}
|
||||
chapter.name = urlElement.ownText()
|
||||
}
|
||||
chapter.date_upload = select("span.chapter-release-date > i").firstOrNull()?.text().let { parseChapterDate(it) }
|
||||
}
|
||||
return chapter
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@ class MadaraGenerator : ThemeSourceGenerator {
|
|||
MultiLang("Leviatan Scans", "https://leviatanscans.com", listOf("en", "es"), className = "LeviatanScansFactory", overrideVersionCode = 9),
|
||||
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("Reaper Scans", "https://reaperscans.com", listOf("en", "pt-BR"), className = "ReaperScansFactory", pkgName = "reaperscans", overrideVersionCode = 2),
|
||||
MultiLang("Reaper Scans", "https://reaperscans.com", listOf("en", "pt-BR"), className = "ReaperScansFactory", pkgName = "reaperscans", overrideVersionCode = 3),
|
||||
SingleLang("1st Kiss Manga.love", "https://1stkissmanga.love", "en", className = "FirstKissMangaLove"),
|
||||
SingleLang("1st Kiss", "https://1stkissmanga.io", "en", className = "FirstKissManga", pkgName = "firstkissmanga", overrideVersionCode = 6),
|
||||
SingleLang("1st Kiss Manhua", "https://1stkissmanhua.com", "en", className = "FirstKissManhua", overrideVersionCode = 2),
|
||||
|
|
Loading…
Reference in New Issue