Baozi Manhua: fix page list and avoid loading missing images (#14716)
This commit is contained in:
parent
2cc30fb009
commit
2786495dbb
|
@ -1,3 +1,8 @@
|
|||
## 1.3.17 (2022-12-29)
|
||||
|
||||
- 修复部分图片无法加载的问题
|
||||
- 停止加载缺失的图片(原本加载为“漫画”二字)
|
||||
|
||||
## 1.3.16 (2022-12-17)
|
||||
|
||||
- 搜索漫画时自动使用 baozimh.com 域名以避免出错
|
||||
|
|
|
@ -5,7 +5,7 @@ ext {
|
|||
extName = 'Baozi Manhua'
|
||||
pkgNameSuffix = 'zh.baozimanhua'
|
||||
extClass = '.Baozi'
|
||||
extVersionCode = 16
|
||||
extVersionCode = 17
|
||||
}
|
||||
|
||||
apply from: "$rootDir/common.gradle"
|
||||
|
|
|
@ -51,8 +51,12 @@ class Baozi : ParsedHttpSource(), ConfigurableSource {
|
|||
override val client = network.cloudflareClient.newBuilder()
|
||||
.rateLimit(2)
|
||||
.addInterceptor(bannerInterceptor)
|
||||
.addNetworkInterceptor(MissingImageInterceptor)
|
||||
.build()
|
||||
|
||||
override fun headersBuilder() = super.headersBuilder()
|
||||
.add("Referer", "$baseUrl/")
|
||||
|
||||
override fun chapterListSelector() = throw UnsupportedOperationException("Not used.")
|
||||
|
||||
override fun chapterListParse(response: Response): List<SChapter> {
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
package eu.kanade.tachiyomi.extension.zh.baozimanhua
|
||||
|
||||
import okhttp3.Interceptor
|
||||
import okhttp3.Response
|
||||
|
||||
object MissingImageInterceptor : Interceptor {
|
||||
override fun intercept(chain: Interceptor.Chain): Response {
|
||||
val response = chain.proceed(chain.request())
|
||||
if (response.isRedirect && response.header("location") == "https://static-tw.baozimh.com/cover/404.jpg") {
|
||||
return response.newBuilder().code(404).build()
|
||||
}
|
||||
return response
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue