diff --git a/src/zh/dmzj/build.gradle b/src/zh/dmzj/build.gradle index 6a39f7cdc..d7ce2a31e 100644 --- a/src/zh/dmzj/build.gradle +++ b/src/zh/dmzj/build.gradle @@ -5,7 +5,7 @@ ext { appName = 'Tachiyomi: Dmzj' pkgNameSuffix = 'zh.dmzj' extClass = '.Dmzj' - extVersionCode = 8 + extVersionCode = 9 libVersion = '1.2' } 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 6c8e74b41..775ebd370 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 @@ -9,6 +9,7 @@ import eu.kanade.tachiyomi.source.model.Page import eu.kanade.tachiyomi.source.model.SChapter import eu.kanade.tachiyomi.source.model.SManga import eu.kanade.tachiyomi.source.online.HttpSource +import java.net.URLEncoder import java.util.ArrayList import okhttp3.Request import okhttp3.Response @@ -179,6 +180,16 @@ class Dmzj : HttpSource() { return ret } + private fun String.encoded(): String { + return this.chunked(1) + .joinToString("") { if (it in setOf("%", " ", "+", "#")) URLEncoder.encode(it, "UTF-8") else it } + .let { if (it.endsWith(".jp")) "${it}g" else it } + } + + override fun imageRequest(page: Page): Request { + return GET(page.imageUrl!!.encoded(), headers) + } + // Unused, we can get image urls directly from the chapter page override fun imageUrlParse(response: Response) = throw UnsupportedOperationException("This method should not be called!")