From 0b29192c10c83769bfadd922c34476be7e072575 Mon Sep 17 00:00:00 2001 From: Fioren <102145692+FiorenMas@users.noreply.github.com> Date: Wed, 27 Nov 2024 21:42:29 +0700 Subject: [PATCH] Fix TopTruyen (#6346) * Fix TopTruyen Fix issue "Not page found" * Update src/vi/toptruyen/src/eu/kanade/tachiyomi/extension/vi/toptruyen/TopTruyen.kt Co-authored-by: Vetle Ledaal --------- Co-authored-by: Vetle Ledaal --- src/vi/toptruyen/build.gradle | 2 +- .../kanade/tachiyomi/extension/vi/toptruyen/TopTruyen.kt | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/vi/toptruyen/build.gradle b/src/vi/toptruyen/build.gradle index b2094db52..ec4648a80 100644 --- a/src/vi/toptruyen/build.gradle +++ b/src/vi/toptruyen/build.gradle @@ -3,7 +3,7 @@ ext { extClass = '.TopTruyen' themePkg = 'wpcomics' baseUrl = 'https://www.toptruyento.pro' - overrideVersionCode = 2 + overrideVersionCode = 3 isNsfw = true } diff --git a/src/vi/toptruyen/src/eu/kanade/tachiyomi/extension/vi/toptruyen/TopTruyen.kt b/src/vi/toptruyen/src/eu/kanade/tachiyomi/extension/vi/toptruyen/TopTruyen.kt index 86205a4b7..6d5b2b239 100644 --- a/src/vi/toptruyen/src/eu/kanade/tachiyomi/extension/vi/toptruyen/TopTruyen.kt +++ b/src/vi/toptruyen/src/eu/kanade/tachiyomi/extension/vi/toptruyen/TopTruyen.kt @@ -4,6 +4,7 @@ import eu.kanade.tachiyomi.multisrc.wpcomics.WPComics import eu.kanade.tachiyomi.network.GET import eu.kanade.tachiyomi.network.interceptor.rateLimit import eu.kanade.tachiyomi.source.model.FilterList +import eu.kanade.tachiyomi.source.model.Page import eu.kanade.tachiyomi.source.model.SChapter import eu.kanade.tachiyomi.source.model.SManga import okhttp3.HttpUrl.Companion.toHttpUrl @@ -24,6 +25,13 @@ class TopTruyen : WPComics( .rateLimit(3) .build() + override fun pageListParse(document: Document): List { + return document.select(".page-chapter img") + .mapNotNull(::imageOrNull) + .distinct() + .mapIndexed { i, image -> Page(i, imageUrl = image) } + } + override fun popularMangaSelector() = "div.item-manga div.item" override fun popularMangaFromElement(element: Element) = SManga.create().apply {