Kemono fix image url path (#9396)

This commit is contained in:
spicemace 2025-06-23 10:10:05 -07:00 committed by Draff
parent 53ff72f22c
commit 4e0a48fff7
Signed by: Draff
GPG Key ID: E8A89F3211677653
2 changed files with 5 additions and 3 deletions

View File

@ -2,4 +2,4 @@ plugins {
id("lib-multisrc")
}
baseVersionCode = 21
baseVersionCode = 22

View File

@ -43,6 +43,8 @@ open class Kemono(
private val apiPath = "api/v1"
private val dataPath = "data"
private val imgCdnUrl = baseUrl.replace("//", "//img.")
private var mangasCache: List<KemonoCreatorDto> = emptyList()
@ -231,7 +233,7 @@ open class Kemono(
override fun pageListParse(response: Response): List<Page> {
val postData: KemonoPostDtoWrapped = response.parseAs()
return postData.post.images.mapIndexed { i, path -> Page(i, imageUrl = baseUrl + path) }
return postData.post.images.mapIndexed { i, path -> Page(i, imageUrl = "$baseUrl/$dataPath$path") }
}
override fun imageRequest(page: Page): Request {
@ -242,7 +244,7 @@ open class Kemono(
val index = imageUrl.indexOf('/', 8)
val url = buildString {
append(imageUrl, 0, index)
append("/thumbnail/data")
append("/thumbnail")
append(imageUrl.substring(index))
}
return GET(url, headers)