add rate limiter to Shield Manga (#5922)

This commit is contained in:
Riztard Lanthorn 2021-02-20 04:41:01 +07:00 committed by GitHub
parent cbe5dac026
commit 0abfb4f701
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 1 deletions

View File

@ -0,0 +1,4 @@
dependencies {
implementation project(':lib-ratelimit')
}

View File

@ -0,0 +1,16 @@
package eu.kanade.tachiyomi.extension.en.shieldmanga
import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor
import eu.kanade.tachiyomi.multisrc.madara.Madara
import okhttp3.OkHttpClient
import java.util.concurrent.TimeUnit
class ShieldManga : Madara("Shield Manga", "https://shieldmanga.club", "en") {
private val rateLimitInterceptor = RateLimitInterceptor(1)
override val client: OkHttpClient = network.cloudflareClient.newBuilder()
.connectTimeout(10, TimeUnit.SECONDS)
.readTimeout(30, TimeUnit.SECONDS)
.addNetworkInterceptor(rateLimitInterceptor)
.build()
}

View File

@ -188,7 +188,7 @@ class MadaraGenerator : ThemeSourceGenerator {
SingleLang("Rüya Manga", "https://www.ruyamanga.com", "tr", className = "RuyaManga"), SingleLang("Rüya Manga", "https://www.ruyamanga.com", "tr", className = "RuyaManga"),
SingleLang("S2Manga", "https://s2manga.com", "en"), SingleLang("S2Manga", "https://s2manga.com", "en"),
SingleLang("Sekte Doujin", "https://sektedoujin.xyz", "id", isNsfw = true), SingleLang("Sekte Doujin", "https://sektedoujin.xyz", "id", isNsfw = true),
SingleLang("Shield Manga", "https://shieldmanga.club", "en"), SingleLang("Shield Manga", "https://shieldmanga.club", "en", overrideVersionCode = 1),
SingleLang("ShoujoHearts", "http://shoujohearts.com", "en"), SingleLang("ShoujoHearts", "http://shoujohearts.com", "en"),
SingleLang("SiXiang Scans", "http://www.sixiangscans.com", "en"), SingleLang("SiXiang Scans", "http://www.sixiangscans.com", "en"),
SingleLang("Siyahmelek", "https://siyahmelek.com", "tr", isNsfw = true, overrideVersionCode = 1), SingleLang("Siyahmelek", "https://siyahmelek.com", "tr", isNsfw = true, overrideVersionCode = 1),