Bato.to: Fix no pages found error (#12035)
* Bato.to: Fix no pages found error * Bump extension version * Update Changelog
This commit is contained in:
parent
b4df51d652
commit
1f591f4e23
@ -1,3 +1,9 @@
|
||||
## 1.2.23
|
||||
|
||||
### Fix
|
||||
|
||||
* Update pageListParse logic to handle website changes
|
||||
|
||||
## 1.2.22
|
||||
|
||||
### Features
|
||||
|
@ -6,7 +6,7 @@ ext {
|
||||
extName = 'Bato.to'
|
||||
pkgNameSuffix = 'all.batoto'
|
||||
extClass = '.BatoToFactory'
|
||||
extVersionCode = 22
|
||||
extVersionCode = 23
|
||||
isNsfw = true
|
||||
}
|
||||
|
||||
|
@ -489,6 +489,35 @@ open class BatoTo(
|
||||
pages.add(Page(i, imageUrl = if (server.startsWith("http")) "${server}$imgUrl" else "https:${server}$imgUrl"))
|
||||
}
|
||||
}
|
||||
} else if (script.contains("const imgHttpLis = ") && script.contains("const batoWord = ") && script.contains(
|
||||
"const batoPass = "
|
||||
)
|
||||
) {
|
||||
val duktape = Duktape.create()
|
||||
val imgHttpLis = json.parseToJsonElement(
|
||||
script.substringAfter("const imgHttpLis = ").substringBefore(";")
|
||||
).jsonArray
|
||||
val batoWord = script.substringAfter("const batoWord = ").substringBefore(";")
|
||||
val batoPass =
|
||||
duktape.evaluate(script.substringAfter("const batoPass = ").substringBefore(";"))
|
||||
.toString()
|
||||
val input =
|
||||
cryptoJS + "CryptoJS.AES.decrypt($batoWord, \"$batoPass\").toString(CryptoJS.enc.Utf8);"
|
||||
val imgWordLis = json.parseToJsonElement(duktape.evaluate(input).toString()).jsonArray
|
||||
duktape.close()
|
||||
|
||||
if (imgHttpLis.size == imgWordLis.size) {
|
||||
imgHttpLis.forEachIndexed { i: Int, item ->
|
||||
val imageUrl =
|
||||
"${item.jsonPrimitive.content}?${imgWordLis.get(i).jsonPrimitive.content}"
|
||||
pages.add(
|
||||
Page(
|
||||
i,
|
||||
imageUrl = imageUrl
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return pages
|
||||
|
Loading…
x
Reference in New Issue
Block a user