From bbeb1622cae11647020a00f4ca693afb2444f406 Mon Sep 17 00:00:00 2001 From: Luqman <16263232+Riztard@users.noreply.github.com> Date: Fri, 2 Feb 2024 16:19:56 +0700 Subject: [PATCH] Comic Fx: fix chapter pages (#877) * Comic Fx: fix chapter pages * Update src/id/comicfx/src/eu/kanade/tachiyomi/extension/id/comicfx/ComicFx.kt Co-authored-by: beerpsi <92439990+beerpiss@users.noreply.github.com> * Update src/id/comicfx/src/eu/kanade/tachiyomi/extension/id/comicfx/ComicFx.kt * Update ComicFx.kt * Update ComicFx.kt --------- Co-authored-by: beerpsi <92439990+beerpiss@users.noreply.github.com> --- src/id/comicfx/build.gradle | 2 +- .../kanade/tachiyomi/extension/id/comicfx/ComicFx.kt | 11 +++-------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/id/comicfx/build.gradle b/src/id/comicfx/build.gradle index 15507b823..e5928782d 100644 --- a/src/id/comicfx/build.gradle +++ b/src/id/comicfx/build.gradle @@ -1,7 +1,7 @@ ext { extName = 'Comic Fx' extClass = '.ComicFx' - extVersionCode = 5 + extVersionCode = 6 } apply from: "$rootDir/common.gradle" diff --git a/src/id/comicfx/src/eu/kanade/tachiyomi/extension/id/comicfx/ComicFx.kt b/src/id/comicfx/src/eu/kanade/tachiyomi/extension/id/comicfx/ComicFx.kt index be9d60ffb..c2dae76db 100644 --- a/src/id/comicfx/src/eu/kanade/tachiyomi/extension/id/comicfx/ComicFx.kt +++ b/src/id/comicfx/src/eu/kanade/tachiyomi/extension/id/comicfx/ComicFx.kt @@ -205,16 +205,11 @@ class ComicFx : ParsedHttpSource() { override fun imageUrlParse(document: Document) = "" override fun pageListParse(document: Document): List { - val pages = mutableListOf() + val pages = document.toString().substringAfter("var pages = ").substringBefore(";") - document.select("#all img").mapIndexed { i, element -> - val image = element.attr("abs:src") - if (image != "") { - pages.add(Page(i, "", image)) - } + return json.parseToJsonElement(pages).jsonArray.mapIndexed { i, it -> + Page(i, imageUrl = it.jsonObject["page_image"]!!.jsonPrimitive.content) } - - return pages } // filters