Fix Jaimini's Box, fixes #777 (#781)

Fix Jaimini's Box, fixes #777
This commit is contained in:
Logan B 2019-02-08 10:19:02 +13:00 committed by Carlos
parent 48f676582c
commit 5d669e79a3
2 changed files with 7 additions and 4 deletions

View File

@ -5,7 +5,7 @@ ext {
appName = 'Tachiyomi: FoolSlide'
pkgNameSuffix = "all.foolslide"
extClass = '.FoolSlideFactory'
extVersionCode = 15
extVersionCode = 16
libVersion = '1.2'
}

View File

@ -58,9 +58,12 @@ class JaminisBox : FoolSlide("Jaimini's Box", "https://jaiminisbox.com", "en", "
override fun pageListParse(document: Document): List<Page> {
val doc = document.toString()
val base64Json = doc.substringAfter("JSON.parse(atob(\"").substringBefore("\"));")
val decodeJson = String(Base64.decode(base64Json, Base64.DEFAULT))
val json = JsonParser().parse(decodeJson).asJsonArray
var jsonstr = doc.substringAfter("var pages = ").substringBefore(";")
if (jsonstr.contains("JSON.parse")) {
val base64Json = jsonstr.substringAfter("JSON.parse(atob(\"").substringBefore("\"));")
jsonstr = String(Base64.decode(base64Json, Base64.DEFAULT))
}
val json = JsonParser().parse(jsonstr).asJsonArray
val pages = mutableListOf<Page>()
json.forEach {
pages.add(Page(pages.size, "", it["url"].asString))