diff --git a/src/zh/baozimanhua/CHANGELOG.md b/src/zh/baozimanhua/CHANGELOG.md index 96bc29222..a0e74b68d 100644 --- a/src/zh/baozimanhua/CHANGELOG.md +++ b/src/zh/baozimanhua/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.3.16 (2022-12-17) + +- 搜索漫画时自动使用 baozimh.com 域名以避免出错 + ## 1.3.15 (2022-11-20) - 尝试绕过 Cloudflare diff --git a/src/zh/baozimanhua/build.gradle b/src/zh/baozimanhua/build.gradle index 9ab8f02f9..15603353f 100644 --- a/src/zh/baozimanhua/build.gradle +++ b/src/zh/baozimanhua/build.gradle @@ -5,7 +5,7 @@ ext { extName = 'Baozi Manhua' pkgNameSuffix = 'zh.baozimanhua' extClass = '.Baozi' - extVersionCode = 15 + extVersionCode = 16 } apply from: "$rootDir/common.gradle" diff --git a/src/zh/baozimanhua/src/eu/kanade/tachiyomi/extension/zh/baozimanhua/Baozi.kt b/src/zh/baozimanhua/src/eu/kanade/tachiyomi/extension/zh/baozimanhua/Baozi.kt index 5c7c6e822..3245c2f87 100644 --- a/src/zh/baozimanhua/src/eu/kanade/tachiyomi/extension/zh/baozimanhua/Baozi.kt +++ b/src/zh/baozimanhua/src/eu/kanade/tachiyomi/extension/zh/baozimanhua/Baozi.kt @@ -17,6 +17,7 @@ import eu.kanade.tachiyomi.source.model.SChapter import eu.kanade.tachiyomi.source.model.SManga import eu.kanade.tachiyomi.source.online.ParsedHttpSource import eu.kanade.tachiyomi.util.asJsoup +import okhttp3.HttpUrl.Companion.toHttpUrl import okhttp3.Request import okhttp3.Response import org.jsoup.nodes.Document @@ -187,7 +188,12 @@ class Baozi : ParsedHttpSource(), ConfigurableSource { override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request { // impossible to search a manga and use the filters return if (query.isNotEmpty()) { - GET("$baseUrl/search?q=$query", headers) + val baseUrl = baseUrl.replace("webmota.com", "baozimh.com") + val url = baseUrl.toHttpUrl().newBuilder() + .addEncodedPathSegment("search") + .addQueryParameter("q", query) + .toString() + GET(url, headers) } else { val parts = filters.filterIsInstance().joinToString("&") { it.toUriPart() } GET("$baseUrl/classify?page=$page&$parts", headers) @@ -220,7 +226,8 @@ class Baozi : ParsedHttpSource(), ConfigurableSource { entries = MIRRORS entryValues = MIRRORS summary = "已选择:%s\n" + - "重启生效,切换简繁体后需要迁移才能刷新漫画标题。" + "重启生效,切换简繁体后需要迁移才能刷新漫画标题。\n" + + "搜索漫画时自动使用 baozimh.com 域名以避免出错。" setDefaultValue(MIRRORS[0]) }.let { screen.addPreference(it) }