diff --git a/src/fr/japscan/build.gradle b/src/fr/japscan/build.gradle index 05e059312..19c960029 100644 --- a/src/fr/japscan/build.gradle +++ b/src/fr/japscan/build.gradle @@ -6,7 +6,7 @@ ext { extName = 'Japscan' pkgNameSuffix = 'fr.japscan' extClass = '.Japscan' - extVersionCode = 31 + extVersionCode = 32 } dependencies { diff --git a/src/fr/japscan/src/eu/kanade/tachiyomi/extension/fr/japscan/Japscan.kt b/src/fr/japscan/src/eu/kanade/tachiyomi/extension/fr/japscan/Japscan.kt index f27d9720c..e1e5a2091 100644 --- a/src/fr/japscan/src/eu/kanade/tachiyomi/extension/fr/japscan/Japscan.kt +++ b/src/fr/japscan/src/eu/kanade/tachiyomi/extension/fr/japscan/Japscan.kt @@ -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() val handler = Handler(Looper.getMainLooper()) val checkNew = ArrayList(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()