mirror of
https://github.com/keiyoushi/extensions-source.git
synced 2024-11-23 02:42:35 +01:00
parent
d5d75b2b03
commit
71c2334034
@ -1,9 +0,0 @@
|
||||
ext {
|
||||
extName = 'RagnarokScan'
|
||||
extClass = '.RagnarokScan'
|
||||
themePkg = 'madara'
|
||||
baseUrl = 'https://ragnarokscan.com'
|
||||
overrideVersionCode = 1
|
||||
}
|
||||
|
||||
apply from: "$rootDir/common.gradle"
|
Binary file not shown.
Before Width: | Height: | Size: 2.4 KiB |
Binary file not shown.
Before Width: | Height: | Size: 1.3 KiB |
Binary file not shown.
Before Width: | Height: | Size: 3.4 KiB |
Binary file not shown.
Before Width: | Height: | Size: 6.2 KiB |
Binary file not shown.
Before Width: | Height: | Size: 8.9 KiB |
@ -1,80 +0,0 @@
|
||||
package eu.kanade.tachiyomi.extension.es.ragnarokscan
|
||||
|
||||
import eu.kanade.tachiyomi.multisrc.madara.Madara
|
||||
import eu.kanade.tachiyomi.multisrc.madara.WordSet
|
||||
import eu.kanade.tachiyomi.source.model.SChapter
|
||||
import eu.kanade.tachiyomi.source.model.SManga
|
||||
import org.jsoup.nodes.Element
|
||||
import java.text.ParseException
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.Locale
|
||||
|
||||
class RagnarokScan : Madara(
|
||||
"RagnarokScan",
|
||||
"https://ragnarokscan.com",
|
||||
"es",
|
||||
SimpleDateFormat("MMMMM dd, yyyy", Locale("es")),
|
||||
) {
|
||||
// "mangaSubstring" has changed, so users will have to migrate
|
||||
override val versionId = 2
|
||||
override val mangaSubString = "series"
|
||||
override val chapterUrlSuffix = ""
|
||||
|
||||
override fun popularMangaSelector() = "div#series-card:has(a:not([href*='bilibilicomics.com']))"
|
||||
override val popularMangaUrlSelector = "a.series-link"
|
||||
|
||||
override val mangaDetailsSelectorTag = "div.tags-content a.notUsed" // Source use this for the scanlator
|
||||
override val mangaDetailsSelectorStatus = "div.post-status div.summary-content"
|
||||
|
||||
override fun popularMangaFromElement(element: Element): SManga {
|
||||
val manga = SManga.create()
|
||||
|
||||
with(element) {
|
||||
selectFirst(popularMangaUrlSelector)!!.let {
|
||||
manga.setUrlWithoutDomain(it.attr("abs:href"))
|
||||
manga.title = it.attr("title")
|
||||
}
|
||||
|
||||
selectFirst("img")?.let {
|
||||
manga.thumbnail_url = imageFromElement(it)
|
||||
}
|
||||
}
|
||||
|
||||
return manga
|
||||
}
|
||||
|
||||
override fun chapterFromElement(element: Element): SChapter {
|
||||
val chapter = SChapter.create()
|
||||
|
||||
with(element) {
|
||||
selectFirst(chapterUrlSelector)!!.let { urlElement ->
|
||||
chapter.url = urlElement.attr("abs:href").let {
|
||||
it.substringBefore("?style=paged") + if (!it.endsWith(chapterUrlSuffix)) chapterUrlSuffix else ""
|
||||
}
|
||||
chapter.name = urlElement.select("p.chapter-manhwa-title").text()
|
||||
chapter.date_upload = parseChapterDate(select("span.chapter-release-date").text())
|
||||
}
|
||||
}
|
||||
|
||||
return chapter
|
||||
}
|
||||
|
||||
override fun parseChapterDate(date: String?): Long {
|
||||
date ?: return 0
|
||||
|
||||
fun SimpleDateFormat.tryParse(string: String): Long {
|
||||
return try {
|
||||
parse(string)?.time ?: 0
|
||||
} catch (_: ParseException) {
|
||||
0
|
||||
}
|
||||
}
|
||||
|
||||
return when {
|
||||
WordSet("minuto", "minutos", "hora", "horas", "día", "días").endsWith(date) -> {
|
||||
parseRelativeDate(date)
|
||||
}
|
||||
else -> SimpleDateFormat("MMMMM dd, yyyy", Locale("es")).tryParse(date)
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user