From a54974e45fbf05b156d2aaa451880cd3e1ba1fbe Mon Sep 17 00:00:00 2001 From: Alessandro Jean Date: Fri, 7 May 2021 12:08:11 -0300 Subject: [PATCH] Add a new source to Madara (closes #6878). (#6885) --- .../madara/blmanhwaclub/src/BlManhwaClub.kt | 51 +++++++++++++++++++ .../tachiyomi/multisrc/madara/Madara.kt | 4 +- .../multisrc/madara/MadaraGenerator.kt | 1 + 3 files changed, 54 insertions(+), 2 deletions(-) create mode 100644 multisrc/overrides/madara/blmanhwaclub/src/BlManhwaClub.kt diff --git a/multisrc/overrides/madara/blmanhwaclub/src/BlManhwaClub.kt b/multisrc/overrides/madara/blmanhwaclub/src/BlManhwaClub.kt new file mode 100644 index 000000000..db812b7ce --- /dev/null +++ b/multisrc/overrides/madara/blmanhwaclub/src/BlManhwaClub.kt @@ -0,0 +1,51 @@ +package eu.kanade.tachiyomi.extension.pt.blmanhwaclub + +import eu.kanade.tachiyomi.annotations.Nsfw +import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor +import eu.kanade.tachiyomi.multisrc.madara.Madara +import okhttp3.OkHttpClient +import java.text.SimpleDateFormat +import java.util.Locale +import java.util.concurrent.TimeUnit + +@Nsfw +class BlManhwaClub : Madara( + "BL Manhwa Club", + "https://blmanhwa.club", + "pt-BR", + SimpleDateFormat("dd MMM yyyy", Locale("pt", "BR")) +) { + + override val client: OkHttpClient = super.client.newBuilder() + .addInterceptor(RateLimitInterceptor(1, 1, TimeUnit.SECONDS)) + .build() + + // [...document.querySelectorAll('div.genres li a')] + // .map(x => `Genre("${x.innerText.slice(1, -4).replace('(', '').trim()}", "${x.href.replace(/.*genero\/(.*)\//, '$1')}")`) + // .join(',\n') + override fun getGenreList(): List = listOf( + Genre("Ação", "acao"), + Genre("Adulto", "adulto"), + Genre("Aventura", "aventura"), + Genre("Comédia", "comedia"), + Genre("Cotidiano", "cotidiano"), + Genre("Drama", "drama"), + Genre("Esporte", "esporte"), + Genre("Fantasia", "fantasia"), + Genre("Gender Bender", "gender-bender"), + Genre("Histórico", "historico"), + Genre("Horror", "horror"), + Genre("Mafia", "mafia"), + Genre("Mistério", "misterio"), + Genre("Omegaverse", "omegaverse"), + Genre("Psicológico", "psicologico"), + Genre("Romance", "romance"), + Genre("Sci-fi", "sci-fi"), + Genre("Shounen Ai", "shounen-ai"), + Genre("Sobrenatural", "sobrenatural"), + Genre("Super Herói", "super-heroi"), + Genre("Tragédia", "tragedia"), + Genre("Vida Escolar", "vida-escolar"), + Genre("Yaoi", "yaoi") + ) +} diff --git a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/madara/Madara.kt b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/madara/Madara.kt index 23056fdb5..9f1dc1827 100644 --- a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/madara/Madara.kt +++ b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/madara/Madara.kt @@ -350,8 +350,8 @@ abstract class Madara( manga.status = when (it.text()) { // I don't know what's the corresponding for COMPLETED and LICENSED // There's no support for "Canceled" or "On Hold" - "Completed", "Completo", "Concluído", "Terminé" -> SManga.COMPLETED - "OnGoing", "Продолжается", "Updating", "Em Lançamento", "Em andamento", "En cours" -> SManga.ONGOING + "Completed", "Completo", "Concluído", "Concluido", "Terminé" -> SManga.COMPLETED + "OnGoing", "Продолжается", "Updating", "Em Lançamento", "Em andamento", "En cours", "Ativo" -> SManga.ONGOING else -> SManga.UNKNOWN } } diff --git a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/madara/MadaraGenerator.kt b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/madara/MadaraGenerator.kt index 7812d700f..cc190612b 100644 --- a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/madara/MadaraGenerator.kt +++ b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/madara/MadaraGenerator.kt @@ -31,6 +31,7 @@ class MadaraGenerator : ThemeSourceGenerator { SingleLang("ATM-Subs", "https://atm-subs.fr", "fr", className = "ATMSubs"), SingleLang("AYATOON", "https://ayatoon.com", "tr"), SingleLang("Azora", "https://azoramanga.com", "ar", overrideVersionCode = 1), + SingleLang("BL Manhwa Club", "https://blmanhwa.club", "pt-BR", isNsfw = true, className = "BlManhwaClub"), SingleLang("Bakaman", "https://bakaman.net", "th", overrideVersionCode = 1), SingleLang("BestManga", "https://bestmanga.club", "ru"), SingleLang("BestManhua", "https://bestmanhua.com", "en", overrideVersionCode = 1),