Add a new source to MangaSar. (#13998)

This commit is contained in:
Alessandro Jean 2022-10-26 16:07:17 -03:00 committed by GitHub
parent a51c32b907
commit 55e62035c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 29 additions and 0 deletions

View File

@ -0,0 +1,28 @@
package eu.kanade.tachiyomi.extension.pt.firemangas
import eu.kanade.tachiyomi.multisrc.mangasar.MangaSar
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.util.asJsoup
import okhttp3.Request
import okhttp3.Response
import org.jsoup.nodes.Element
class FireMangas : MangaSar("Fire Mangás", "https://firemangas.com", "pt-BR") {
override fun chapterListPaginatedRequest(mangaUrl: String, page: Int): Request {
return GET(baseUrl + mangaUrl, headers)
}
override fun chapterListParse(response: Response): List<SChapter> {
return response.asJsoup()
.select("ul.full-chapters-list > li > a")
.map(::chapterFromElement)
}
private fun chapterFromElement(element: Element): SChapter = SChapter.create().apply {
name = element.selectFirst("span.cap-text")!!.text()
date_upload = element.selectFirst("span.chapter-date")?.text()?.toDate() ?: 0L
setUrlWithoutDomain(element.attr("href"))
}
}

View File

@ -12,6 +12,7 @@ class MangaSarGenerator : ThemeSourceGenerator {
override val baseVersionCode: Int = 7
override val sources = listOf(
SingleLang("Fire Mangás", "https://firemangas.com", "pt-BR", className = "FireMangas"),
SingleLang("Mangazim", "https://mangazim.com", "pt-BR"),
SingleLang("Meus Mangás", "https://meusmangas.net", "pt-BR", isNsfw = true, className = "MeusMangas", overrideVersionCode = 2)
)