From defa788dd5efe600752d1166d64736cbb56fd28c Mon Sep 17 00:00:00 2001 From: stevenyomi <95685115+stevenyomi@users.noreply.github.com> Date: Thu, 11 Jan 2024 19:08:29 +0800 Subject: [PATCH] DMZJ: fix comment page (Brotli issue) (#145) --- src/zh/dmzj/build.gradle | 2 +- .../src/eu/kanade/tachiyomi/extension/zh/dmzj/Dmzj.kt | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/zh/dmzj/build.gradle b/src/zh/dmzj/build.gradle index d6f44343f..ac66674e4 100644 --- a/src/zh/dmzj/build.gradle +++ b/src/zh/dmzj/build.gradle @@ -6,7 +6,7 @@ ext { extName = 'DMZJ' pkgNameSuffix = 'zh.dmzj' extClass = '.Dmzj' - extVersionCode = 41 + extVersionCode = 42 } apply from: "$rootDir/common.gradle" diff --git a/src/zh/dmzj/src/eu/kanade/tachiyomi/extension/zh/dmzj/Dmzj.kt b/src/zh/dmzj/src/eu/kanade/tachiyomi/extension/zh/dmzj/Dmzj.kt index 09f857459..59a1b9f6c 100644 --- a/src/zh/dmzj/src/eu/kanade/tachiyomi/extension/zh/dmzj/Dmzj.kt +++ b/src/zh/dmzj/src/eu/kanade/tachiyomi/extension/zh/dmzj/Dmzj.kt @@ -27,7 +27,7 @@ class Dmzj : ConfigurableSource, HttpSource() { override val lang = "zh" override val supportsLatest = true override val name = "动漫之家" - override val baseUrl = "https://m.dmzj.com" + override val baseUrl = "https://m.idmzj.com" private val preferences: SharedPreferences = Injekt.get().getSharedPreferences("source_$id", 0x0000) @@ -36,6 +36,13 @@ class Dmzj : ConfigurableSource, HttpSource() { .addInterceptor(ImageUrlInterceptor) .addInterceptor(CommentsInterceptor) .rateLimit(4) + .apply { + val interceptors = interceptors() + val index = interceptors.indexOfFirst { "Brotli" in it.javaClass.simpleName } + if (index >= 0) { + interceptors.add(interceptors.removeAt(index)) + } + } .build() // API v4 randomly fails