diff --git a/multisrc/overrides/mangasar/firemangas/src/FireMangas.kt b/multisrc/overrides/mangasar/firemangas/src/FireMangas.kt new file mode 100644 index 000000000..258e3543f --- /dev/null +++ b/multisrc/overrides/mangasar/firemangas/src/FireMangas.kt @@ -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 { + 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")) + } +} diff --git a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/mangasar/MangaSarGenerator.kt b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/mangasar/MangaSarGenerator.kt index f542b2526..4b7e7468c 100644 --- a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/mangasar/MangaSarGenerator.kt +++ b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/mangasar/MangaSarGenerator.kt @@ -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) )