Baozi Manhua: fix page list and avoid loading missing images (#14716)

This commit is contained in:
stevenyomi 2022-12-30 00:01:36 +08:00 committed by GitHub
parent 2cc30fb009
commit 2786495dbb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 24 additions and 1 deletions

View File

@ -1,3 +1,8 @@
## 1.3.17 (2022-12-29)
- 修复部分图片无法加载的问题
- 停止加载缺失的图片(原本加载为“漫画”二字)
## 1.3.16 (2022-12-17)
- 搜索漫画时自动使用 baozimh.com 域名以避免出错

View File

@ -5,7 +5,7 @@ ext {
extName = 'Baozi Manhua'
pkgNameSuffix = 'zh.baozimanhua'
extClass = '.Baozi'
extVersionCode = 16
extVersionCode = 17
}
apply from: "$rootDir/common.gradle"

View File

@ -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> {

View File

@ -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
}
}