RainOfSnow: add rate limit 2/s (#7205)

This commit is contained in:
Riztard Lanthorn 2021-05-24 20:31:16 +07:00 committed by GitHub
parent 7d05f193fe
commit 4cfe1f462f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View File

@ -5,9 +5,13 @@ ext {
extName = 'Rain Of Snow'
pkgNameSuffix = 'en.rainofsnow'
extClass = '.RainOfSnow'
extVersionCode = 6
extVersionCode = 7
libVersion = '1.2'
containsNsfw = false
}
dependencies {
implementation project(path: ':lib-ratelimit')
}
apply from: "$rootDir/common.gradle"

View File

@ -1,5 +1,6 @@
package eu.kanade.tachiyomi.extension.en.rainofsnow
import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.source.model.Filter
import eu.kanade.tachiyomi.source.model.FilterList
@ -28,9 +29,12 @@ open class RainOfSnow() : ParsedHttpSource() {
override val supportsLatest = false
private val rateLimitInterceptor = RateLimitInterceptor(2)
override val client: OkHttpClient = network.cloudflareClient.newBuilder()
.connectTimeout(10, TimeUnit.SECONDS)
.readTimeout(30, TimeUnit.SECONDS)
.addNetworkInterceptor(rateLimitInterceptor)
.build()
override fun popularMangaRequest(page: Int): Request {