41 lines
1.5 KiB
Kotlin
41 lines
1.5 KiB
Kotlin
package eu.kanade.tachiyomi.extension.es.manhwalatino
|
|
|
|
import eu.kanade.tachiyomi.multisrc.madara.Madara
|
|
import eu.kanade.tachiyomi.source.model.SChapter
|
|
import org.jsoup.nodes.Element
|
|
import java.text.SimpleDateFormat
|
|
import java.util.Locale
|
|
|
|
class ManhwaLatino : Madara(
|
|
"Manhwa-Latino",
|
|
"https://manhwa-latino.com",
|
|
"es",
|
|
SimpleDateFormat("dd/MM/yyyy", Locale("es")),
|
|
) {
|
|
override val useNewChapterEndpoint = true
|
|
|
|
override val chapterUrlSelector = "div.mini-letters > a"
|
|
|
|
override val mangaDetailsSelectorStatus = "div.post-content_item:contains(Estado del comic) > div.summary-content"
|
|
override val mangaDetailsSelectorDescription = "div.post-content_item:contains(Resumen) > h3 > div.summary-container"
|
|
|
|
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.wholeText().substringAfter("\n")
|
|
}
|
|
|
|
chapter.date_upload = select("img:not(.thumb)").firstOrNull()?.attr("alt")?.let { parseRelativeDate(it) }
|
|
?: select("span a").firstOrNull()?.attr("title")?.let { parseRelativeDate(it) }
|
|
?: parseChapterDate(select(chapterDateSelector()).firstOrNull()?.text())
|
|
}
|
|
|
|
return chapter
|
|
}
|
|
}
|