From cf29bdafd32d12d17cf08b63d6bcea3265e2b251 Mon Sep 17 00:00:00 2001 From: Chopper <156493704+choppeh@users.noreply.github.com> Date: Mon, 13 Jan 2025 18:18:20 -0300 Subject: [PATCH] Add ApenasUmaFa (#7147) * Add ApenasUmaFa * Removes the super statement Co-authored-by: AwkwardPeak7 <48650614+AwkwardPeak7@users.noreply.github.com> --------- Co-authored-by: AwkwardPeak7 <48650614+AwkwardPeak7@users.noreply.github.com> --- src/pt/apenasumafa/build.gradle | 9 ++++ .../extension/pt/apenasumafa/ApenasUmaFa.kt | 44 +++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 src/pt/apenasumafa/build.gradle create mode 100644 src/pt/apenasumafa/src/eu/kanade/tachiyomi/extension/pt/apenasumafa/ApenasUmaFa.kt diff --git a/src/pt/apenasumafa/build.gradle b/src/pt/apenasumafa/build.gradle new file mode 100644 index 000000000..c8af9e7f3 --- /dev/null +++ b/src/pt/apenasumafa/build.gradle @@ -0,0 +1,9 @@ +ext { + extName = 'Apenas Uma Fã' + extClass = '.ApenasUmaFa' + themePkg = 'zeistmanga' + baseUrl = 'https://apenasuma-fa.blogspot.com' + overrideVersionCode = 0 +} + +apply from: "$rootDir/common.gradle" diff --git a/src/pt/apenasumafa/src/eu/kanade/tachiyomi/extension/pt/apenasumafa/ApenasUmaFa.kt b/src/pt/apenasumafa/src/eu/kanade/tachiyomi/extension/pt/apenasumafa/ApenasUmaFa.kt new file mode 100644 index 000000000..1df3851ef --- /dev/null +++ b/src/pt/apenasumafa/src/eu/kanade/tachiyomi/extension/pt/apenasumafa/ApenasUmaFa.kt @@ -0,0 +1,44 @@ +package eu.kanade.tachiyomi.extension.pt.apenasumafa + +import eu.kanade.tachiyomi.multisrc.zeistmanga.ZeistManga +import eu.kanade.tachiyomi.source.model.SManga +import eu.kanade.tachiyomi.util.asJsoup +import okhttp3.Response +import org.jsoup.nodes.Document + +class ApenasUmaFa : ZeistManga( + "Apenas Uma Fã", + "https://apenasuma-fa.blogspot.com", + "pt-BR", +) { + override val supportsLatest = false + + override fun fetchPopularManga(page: Int) = fetchLatestUpdates(page) + + override fun mangaDetailsParse(response: Response) = SManga.create().apply { + val document = response.asJsoup() + title = document.selectFirst("h1")!!.text() + thumbnail_url = document.selectFirst("thum") + ?.attr("style") + ?.substringAfter("url(\"") + ?.substringBeforeLast("\"") + description = document.selectFirst("#synopsis")?.text() + genre = document.select("a[href*='search/label'].leading-none").joinToString { it.text() } + document.selectFirst("div[class*=bg-green] span")?.ownText()?.let { + status = when (it.lowercase()) { + "em lançamento" -> SManga.ONGOING + else -> SManga.UNKNOWN + } + } + } + + override fun getChapterFeedUrl(doc: Document): String { + val feed = doc.selectFirst(".chapter_get")!!.attr("data-labelchapter") + return apiUrl(feed) + .addQueryParameter("start-index", "1") + .addQueryParameter("max-results", maxChapterResults.toString()) + .build().toString() + } + + override val pageListSelector = "#reader div.separator" +}