fix kisslove (#3208)
* fix kisslove * update overrideVersionCode * fix function name * fix lint * fix code * improve code quality
This commit is contained in:
parent
f860926491
commit
6a1cd83b51
|
@ -3,7 +3,7 @@ ext {
|
||||||
extClass = '.KissLove'
|
extClass = '.KissLove'
|
||||||
themePkg = 'fmreader'
|
themePkg = 'fmreader'
|
||||||
baseUrl = 'https://klz9.com'
|
baseUrl = 'https://klz9.com'
|
||||||
overrideVersionCode = 5
|
overrideVersionCode = 6
|
||||||
isNsfw = true
|
isNsfw = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@ class KissLove : FMReader("KissLove", "https://klz9.com", "ja") {
|
||||||
?.groupValues?.get(1)
|
?.groupValues?.get(1)
|
||||||
?: throw Exception("Could not find manga id")
|
?: 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)
|
.addQueryParameter("slug", mangaId)
|
||||||
.build()
|
.build()
|
||||||
|
|
||||||
|
@ -70,14 +70,19 @@ class KissLove : FMReader("KissLove", "https://klz9.com", "ja") {
|
||||||
?.`val`()
|
?.`val`()
|
||||||
?: throw Exception("Could not find chapter id")
|
?: 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)
|
.addQueryParameter("cid", chapterId)
|
||||||
.build()
|
.build()
|
||||||
|
|
||||||
return GET(xhrUrl, headers)
|
return GET(xhrUrl, headers)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun generateRandomStr(length: Int): String {
|
||||||
|
return (1..length).map { TO_PATH_CHARACTERS.random() }.joinToString("")
|
||||||
|
}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
|
private val TO_PATH_CHARACTERS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"
|
||||||
private val MID_URL_REGEX = "-([^.]+).html".toRegex()
|
private val MID_URL_REGEX = "-([^.]+).html".toRegex()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue