Baozi Manhua: use Cloudflare client and fix page list for TC (#14310)

* Baozi Manhua: use Cloudflare client

* fix page list parsing for Traditional Chinese
This commit is contained in:
stevenyomi 2022-11-21 00:09:23 +08:00 committed by GitHub
parent b71748e711
commit 96394f35d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 3 deletions

View File

@ -1,3 +1,8 @@
## 1.3.15 (2022-11-20)
- 尝试绕过 Cloudflare
- 修复繁体镜像无法加载多页图片的问题
## 1.3.14 (2022-11-14) ## 1.3.14 (2022-11-14)
- 修复未分页的章节不断加载后续章节图片的问题 - 修复未分页的章节不断加载后续章节图片的问题

View File

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

View File

@ -47,7 +47,7 @@ class Baozi : ParsedHttpSource(), ConfigurableSource {
level = preferences.getString(BaoziBanner.PREF, DEFAULT_LEVEL)!!.toInt() level = preferences.getString(BaoziBanner.PREF, DEFAULT_LEVEL)!!.toInt()
) )
override val client = network.client.newBuilder() override val client = network.cloudflareClient.newBuilder()
.rateLimit(2) .rateLimit(2)
.addInterceptor(bannerInterceptor) .addInterceptor(bannerInterceptor)
.build() .build()
@ -145,7 +145,10 @@ class Baozi : ParsedHttpSource(), ConfigurableSource {
Page(i++, imageUrl = element.attr("src")) Page(i++, imageUrl = element.attr("src"))
} }
url = document.selectFirst(Evaluator.Id("next-chapter")) url = document.selectFirst(Evaluator.Id("next-chapter"))
?.takeIf { it.text() == "下一页" } ?.takeIf {
val text = it.text()
text == "下一页" || text == "下一頁"
}
?.attr("href") ?.attr("href")
?: break ?: break
} }