parent
c2797eed13
commit
d83d23685f
@ -3,7 +3,7 @@ ext {
|
||||
extClass = '.DemonSect'
|
||||
themePkg = 'madara'
|
||||
baseUrl = 'https://dsectcomics.org'
|
||||
overrideVersionCode = 7
|
||||
overrideVersionCode = 8
|
||||
}
|
||||
|
||||
apply from: "$rootDir/common.gradle"
|
||||
|
@ -4,7 +4,9 @@ import eu.kanade.tachiyomi.multisrc.madara.Madara
|
||||
import eu.kanade.tachiyomi.network.asObservable
|
||||
import eu.kanade.tachiyomi.network.interceptor.rateLimit
|
||||
import eu.kanade.tachiyomi.source.model.MangasPage
|
||||
import okhttp3.MediaType.Companion.toMediaType
|
||||
import okhttp3.OkHttpClient
|
||||
import okhttp3.ResponseBody.Companion.toResponseBody
|
||||
import okio.IOException
|
||||
import rx.Observable
|
||||
import java.text.SimpleDateFormat
|
||||
@ -30,6 +32,20 @@ class DemonSect : Madara(
|
||||
}
|
||||
response
|
||||
}
|
||||
.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
|
||||
}
|
||||
.rateLimit(1, 2, TimeUnit.SECONDS)
|
||||
.build()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user