Fix japscan download (#12827)

This commit is contained in:
BRAMILLE Sébastien 2022-07-31 23:58:51 +02:00 committed by GitHub
parent 26fa0af501
commit 9884a8a060
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View File

@ -6,7 +6,7 @@ ext {
extName = 'Japscan'
pkgNameSuffix = 'fr.japscan'
extClass = '.Japscan'
extVersionCode = 31
extVersionCode = 32
}
dependencies {

View File

@ -350,11 +350,12 @@ class Japscan : ConfigurableSource, ParsedHttpSource() {
Log.d("japscan", "ZJS at $zjsurl")
val zjs = client.newCall(GET(baseUrl + zjsurl, headers)).execute().body!!.string()
Log.d("japscan", "webtoon, netdumping initiated")
val pagecount = document.getElementsByTag("option").size
val pagesElement = document.getElementById("pages")
val pagecount = pagesElement.getElementsByTag("option").size
val pages = ArrayList<Page>()
val handler = Handler(Looper.getMainLooper())
val checkNew = ArrayList<String>(pagecount)
var maxIter = document.getElementsByTag("option").size
var maxIter = pagecount
var isSinglePage = false
if ((zjs.lowercase(Locale.ROOT).split("new image").size - 1) == 1) {
isSinglePage = true
@ -395,7 +396,7 @@ class Japscan : ConfigurableSource, ParsedHttpSource() {
if (isSinglePage) {
webView?.loadUrl(baseUrl + document.select("li[^data-]").first().dataset()["chapter-url"])
} else {
webView?.loadUrl(baseUrl + document.getElementsByTag("option")[i].attr("value"))
webView?.loadUrl(baseUrl + pagesElement.getElementsByTag("option")[i].attr("value"))
}
}
barrier.await()