diff --git a/src/all/batoto/CHANGELOG.md b/src/all/batoto/CHANGELOG.md index 54865e13d..0532f3a6c 100644 --- a/src/all/batoto/CHANGELOG.md +++ b/src/all/batoto/CHANGELOG.md @@ -1,3 +1,9 @@ +## 1.2.23 + +### Fix + +* Update pageListParse logic to handle website changes + ## 1.2.22 ### Features diff --git a/src/all/batoto/build.gradle b/src/all/batoto/build.gradle index 74bd90a2b..89f0e2dcb 100644 --- a/src/all/batoto/build.gradle +++ b/src/all/batoto/build.gradle @@ -6,7 +6,7 @@ ext { extName = 'Bato.to' pkgNameSuffix = 'all.batoto' extClass = '.BatoToFactory' - extVersionCode = 22 + extVersionCode = 23 isNsfw = true } diff --git a/src/all/batoto/src/eu/kanade/tachiyomi/extension/all/batoto/BatoTo.kt b/src/all/batoto/src/eu/kanade/tachiyomi/extension/all/batoto/BatoTo.kt index df7680ade..4ae1d35ed 100644 --- a/src/all/batoto/src/eu/kanade/tachiyomi/extension/all/batoto/BatoTo.kt +++ b/src/all/batoto/src/eu/kanade/tachiyomi/extension/all/batoto/BatoTo.kt @@ -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