From 6a1cd83b516e51967cea48af48e10cf83ddbcd24 Mon Sep 17 00:00:00 2001 From: 2Loong6 <1727963726@qq.com> Date: Fri, 24 May 2024 23:36:44 +0800 Subject: [PATCH] fix kisslove (#3208) * fix kisslove * update overrideVersionCode * fix function name * fix lint * fix code * improve code quality --- src/ja/kisslove/build.gradle | 2 +- .../kanade/tachiyomi/extension/ja/kisslove/KissLove.kt | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/ja/kisslove/build.gradle b/src/ja/kisslove/build.gradle index 8e45b5981..6f08f8b9c 100644 --- a/src/ja/kisslove/build.gradle +++ b/src/ja/kisslove/build.gradle @@ -3,7 +3,7 @@ ext { extClass = '.KissLove' themePkg = 'fmreader' baseUrl = 'https://klz9.com' - overrideVersionCode = 5 + overrideVersionCode = 6 isNsfw = true } diff --git a/src/ja/kisslove/src/eu/kanade/tachiyomi/extension/ja/kisslove/KissLove.kt b/src/ja/kisslove/src/eu/kanade/tachiyomi/extension/ja/kisslove/KissLove.kt index 245fad527..e8e7d7d37 100644 --- a/src/ja/kisslove/src/eu/kanade/tachiyomi/extension/ja/kisslove/KissLove.kt +++ b/src/ja/kisslove/src/eu/kanade/tachiyomi/extension/ja/kisslove/KissLove.kt @@ -22,7 +22,7 @@ class KissLove : FMReader("KissLove", "https://klz9.com", "ja") { ?.groupValues?.get(1) ?: throw Exception("Could not find manga id") - val xhrUrl = "$baseUrl/app/manga/controllers/cont.listChapter.php".toHttpUrl().newBuilder() + val xhrUrl = "$baseUrl/${generateRandomStr(25)}.lstc".toHttpUrl().newBuilder() .addQueryParameter("slug", mangaId) .build() @@ -70,14 +70,19 @@ class KissLove : FMReader("KissLove", "https://klz9.com", "ja") { ?.`val`() ?: throw Exception("Could not find chapter id") - val xhrUrl = "$baseUrl/app/manga/controllers/cont.listImg.php".toHttpUrl().newBuilder() + val xhrUrl = "$baseUrl/${generateRandomStr(30)}.iog".toHttpUrl().newBuilder() .addQueryParameter("cid", chapterId) .build() return GET(xhrUrl, headers) } + private fun generateRandomStr(length: Int): String { + return (1..length).map { TO_PATH_CHARACTERS.random() }.joinToString("") + } + companion object { + private val TO_PATH_CHARACTERS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" private val MID_URL_REGEX = "-([^.]+).html".toRegex() } }