parent
96335c8575
commit
b6d14247af
|
@ -3,7 +3,7 @@ ext {
|
|||
extClass = '.ArgosComics'
|
||||
themePkg = 'madara'
|
||||
baseUrl = 'https://argoscomic.com'
|
||||
overrideVersionCode = 3
|
||||
overrideVersionCode = 4
|
||||
}
|
||||
|
||||
apply from: "$rootDir/common.gradle"
|
||||
|
|
|
@ -2,6 +2,8 @@ package eu.kanade.tachiyomi.extension.pt.argoscomics
|
|||
|
||||
import eu.kanade.tachiyomi.multisrc.madara.Madara
|
||||
import eu.kanade.tachiyomi.network.interceptor.rateLimit
|
||||
import okhttp3.MediaType.Companion.toMediaType
|
||||
import okhttp3.ResponseBody.Companion.toResponseBody
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.Locale
|
||||
|
||||
|
@ -13,6 +15,20 @@ class ArgosComics : Madara(
|
|||
) {
|
||||
override val client = super.client.newBuilder()
|
||||
.rateLimit(3)
|
||||
.addInterceptor { chain ->
|
||||
val response = chain.proceed(chain.request())
|
||||
val mime = response.headers["Content-Type"]
|
||||
if (response.isSuccessful) {
|
||||
if (mime == "application/octet-stream" || mime == null) {
|
||||
// Fix image content type
|
||||
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 useLoadMoreRequest = LoadMoreStrategy.Always
|
||||
|
|
Loading…
Reference in New Issue