[RU]Newbie fix 429 Too Many Requests (#14179)

This commit is contained in:
Eshlender 2022-11-08 17:26:22 +05:00 committed by GitHub
parent 90915c6883
commit 7158b05727
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -6,7 +6,7 @@ ext {
extName = 'NewManga(Newbie)'
pkgNameSuffix = 'ru.newbie'
extClass = '.Newbie'
extVersionCode = 16
extVersionCode = 17
}
dependencies {

View File

@ -20,6 +20,7 @@ import eu.kanade.tachiyomi.extension.ru.newbie.dto.SubSearchDto
import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.network.POST
import eu.kanade.tachiyomi.network.asObservableSuccess
import eu.kanade.tachiyomi.network.interceptor.rateLimitHost
import eu.kanade.tachiyomi.source.ConfigurableSource
import eu.kanade.tachiyomi.source.model.Filter
import eu.kanade.tachiyomi.source.model.FilterList
@ -31,6 +32,7 @@ import eu.kanade.tachiyomi.source.online.HttpSource
import kotlinx.serialization.decodeFromString
import kotlinx.serialization.json.Json
import okhttp3.Headers
import okhttp3.HttpUrl.Companion.toHttpUrl
import okhttp3.Interceptor
import okhttp3.MediaType.Companion.toMediaType
import okhttp3.MediaType.Companion.toMediaTypeOrNull
@ -86,6 +88,7 @@ class Newbie : ConfigurableSource, HttpSource() {
override val client: OkHttpClient =
network.cloudflareClient.newBuilder()
.rateLimitHost(API_URL.toHttpUrl(), 2)
.addInterceptor { imageContentTypeIntercept(it) }
.build()