MangaDex: Remove Cloudflare interceptor

This commit is contained in:
arkon 2020-02-15 17:34:14 -05:00
parent 3456660d1e
commit 3f67efea73
2 changed files with 3 additions and 4 deletions

View File

@ -5,7 +5,7 @@ ext {
appName = 'Tachiyomi: MangaDex'
pkgNameSuffix = 'all.mangadex'
extClass = '.MangadexFactory'
extVersionCode = 79
extVersionCode = 80
libVersion = '1.2'
}

View File

@ -48,16 +48,15 @@ abstract class Mangadex(
private val rateLimitInterceptor = RateLimitInterceptor(4)
override val client: OkHttpClient = network.cloudflareClient.newBuilder()
override val client: OkHttpClient = network.client.newBuilder()
.addNetworkInterceptor(rateLimitInterceptor)
.build()
private fun clientBuilder(): OkHttpClient = clientBuilder(getShowR18())
private fun clientBuilder(r18Toggle: Int): OkHttpClient = network.cloudflareClient.newBuilder()
private fun clientBuilder(r18Toggle: Int): OkHttpClient = client.newBuilder()
.connectTimeout(10, TimeUnit.SECONDS)
.readTimeout(30, TimeUnit.SECONDS)
.addNetworkInterceptor(rateLimitInterceptor)
.addNetworkInterceptor { chain ->
val originalCookies = chain.request().header("Cookie") ?: ""
val newReq = chain