Bato.to: Fix page list (#850)

* Bato.to: Fix page list

* Remove overengineering
This commit is contained in:
beerpsi 2024-01-31 18:58:26 +07:00 committed by Draff
parent 0ca16707e2
commit a200ab1081
2 changed files with 10 additions and 3 deletions

View File

@ -1,7 +1,7 @@
ext { ext {
extName = 'Bato.to' extName = 'Bato.to'
extClass = '.BatoToFactory' extClass = '.BatoToFactory'
extVersionCode = 34 extVersionCode = 35
isNsfw = true isNsfw = true
} }

View File

@ -468,8 +468,15 @@ open class BatoTo(
val imgAccListString = CryptoAES.decrypt(batoWord.removeSurrounding("\""), evaluatedPass) val imgAccListString = CryptoAES.decrypt(batoWord.removeSurrounding("\""), evaluatedPass)
val imgAccList = json.parseToJsonElement(imgAccListString).jsonArray.map { it.jsonPrimitive.content } val imgAccList = json.parseToJsonElement(imgAccListString).jsonArray.map { it.jsonPrimitive.content }
return imageUrls.zip(imgAccList).mapIndexed { i, (imgUrl, imgAcc) -> return imageUrls.mapIndexed { i, it ->
Page(i, imageUrl = "$imgUrl?$imgAcc") val acc = imgAccList.getOrNull(i)
val url = if (acc != null) {
"$it?$acc"
} else {
it
}
Page(i, imageUrl = url)
} }
} }