parent
0f2a2f619a
commit
6f9ef9cfdf
@ -3,7 +3,7 @@ ext {
|
||||
extClass = '.ArthurScan'
|
||||
themePkg = 'madara'
|
||||
baseUrl = 'https://arthurscan.xyz'
|
||||
overrideVersionCode = 4
|
||||
overrideVersionCode = 5
|
||||
}
|
||||
|
||||
apply from: "$rootDir/common.gradle"
|
||||
|
@ -2,7 +2,9 @@ package eu.kanade.tachiyomi.extension.pt.arthurscan
|
||||
|
||||
import eu.kanade.tachiyomi.multisrc.madara.Madara
|
||||
import eu.kanade.tachiyomi.network.interceptor.rateLimit
|
||||
import okhttp3.MediaType.Companion.toMediaType
|
||||
import okhttp3.OkHttpClient
|
||||
import okhttp3.ResponseBody.Companion.toResponseBody
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.Locale
|
||||
import java.util.concurrent.TimeUnit
|
||||
@ -16,6 +18,19 @@ class ArthurScan : Madara(
|
||||
|
||||
override val client: OkHttpClient = super.client.newBuilder()
|
||||
.rateLimit(1, 2, TimeUnit.SECONDS)
|
||||
.addInterceptor { chain ->
|
||||
val response = chain.proceed(chain.request())
|
||||
val mime = response.headers["Content-Type"]
|
||||
if (response.isSuccessful) {
|
||||
if (mime == "application/octet-stream" || mime == null) {
|
||||
val type = "image/jpeg".toMediaType()
|
||||
val body = response.body.bytes().toResponseBody(type)
|
||||
return@addInterceptor response.newBuilder().body(body)
|
||||
.header("Content-Type", "image/jpeg").build()
|
||||
}
|
||||
}
|
||||
response
|
||||
}
|
||||
.build()
|
||||
|
||||
override val useNewChapterEndpoint = true
|
||||
|
Loading…
x
Reference in New Issue
Block a user