From 7303f8eae3fb5d1000d4a7d14c77a6cf6c00714f Mon Sep 17 00:00:00 2001 From: seew3l <90949336+seew3l@users.noreply.github.com> Date: Sat, 6 May 2023 09:17:13 -0500 Subject: [PATCH] Manga Crab: Add ratelimit (#16311) Add ratelimit --- multisrc/overrides/madara/mangacrab/src/MangaCrab.kt | 10 ++++++++++ .../tachiyomi/multisrc/madara/MadaraGenerator.kt | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/multisrc/overrides/madara/mangacrab/src/MangaCrab.kt b/multisrc/overrides/madara/mangacrab/src/MangaCrab.kt index 589081024..5161c0524 100644 --- a/multisrc/overrides/madara/mangacrab/src/MangaCrab.kt +++ b/multisrc/overrides/madara/mangacrab/src/MangaCrab.kt @@ -3,13 +3,16 @@ package eu.kanade.tachiyomi.extension.es.mangacrab import android.util.Base64 import eu.kanade.tachiyomi.lib.cryptoaes.CryptoAES import eu.kanade.tachiyomi.multisrc.madara.Madara +import eu.kanade.tachiyomi.network.interceptor.rateLimit import eu.kanade.tachiyomi.source.model.Page import kotlinx.serialization.json.jsonArray import kotlinx.serialization.json.jsonObject import kotlinx.serialization.json.jsonPrimitive +import okhttp3.OkHttpClient import org.jsoup.nodes.Document import java.text.SimpleDateFormat import java.util.Locale +import java.util.concurrent.TimeUnit class MangaCrab : Madara( "Manga Crab", @@ -17,6 +20,13 @@ class MangaCrab : Madara( "es", SimpleDateFormat("dd/MM/yyyy", Locale("es")), ) { + override val client: OkHttpClient = network.cloudflareClient.newBuilder() + .addInterceptor(uaIntercept) + .connectTimeout(10, TimeUnit.SECONDS) + .readTimeout(30, TimeUnit.SECONDS) + .rateLimit(1, 2) + .build() + override fun chapterListSelector() = "div.listing-chapters_wrap > ul > li" override val mangaDetailsSelectorDescription = "div.c-page__content div.contenedor" 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 d31de784d..b5ce64586 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 @@ -185,7 +185,7 @@ class MadaraGenerator : ThemeSourceGenerator { SingleLang("Manga Bilgini", "https://mangabilgini.com", "tr"), SingleLang("Manga Bin", "https://mangabin.com", "en", overrideVersionCode = 1), SingleLang("Manga Chill", "https://toonchill.com", "en", overrideVersionCode = 7), - SingleLang("Manga Crab", "https://mangacrab.com", "es", overrideVersionCode = 3), + SingleLang("Manga Crab", "https://mangacrab.com", "es", overrideVersionCode = 4), SingleLang("Manga District", "https://mangadistrict.com", "en", isNsfw = true, overrideVersionCode = 1), SingleLang("Manga Diyari", "https://manga-diyari.com", "tr", overrideVersionCode = 2), SingleLang("Manga Fenix", "https://manga-fenix.com", "es", overrideVersionCode = 2),