From 6c5462309dd39c0181800f2f03ba36f2c2048c3a Mon Sep 17 00:00:00 2001 From: AwkwardPeak7 <48650614+AwkwardPeak7@users.noreply.github.com> Date: Fri, 17 May 2024 16:28:48 +0500 Subject: [PATCH] Keyoapp: filter dummy pages (#3081) --- lib-multisrc/keyoapp/build.gradle.kts | 2 +- .../eu/kanade/tachiyomi/multisrc/keyoapp/Keyoapp.kt | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/lib-multisrc/keyoapp/build.gradle.kts b/lib-multisrc/keyoapp/build.gradle.kts index e2f11e9c1..6e70fd158 100644 --- a/lib-multisrc/keyoapp/build.gradle.kts +++ b/lib-multisrc/keyoapp/build.gradle.kts @@ -2,4 +2,4 @@ plugins { id("lib-multisrc") } -baseVersionCode = 3 +baseVersionCode = 4 diff --git a/lib-multisrc/keyoapp/src/eu/kanade/tachiyomi/multisrc/keyoapp/Keyoapp.kt b/lib-multisrc/keyoapp/src/eu/kanade/tachiyomi/multisrc/keyoapp/Keyoapp.kt index c1f5f2675..ee31d1855 100644 --- a/lib-multisrc/keyoapp/src/eu/kanade/tachiyomi/multisrc/keyoapp/Keyoapp.kt +++ b/lib-multisrc/keyoapp/src/eu/kanade/tachiyomi/multisrc/keyoapp/Keyoapp.kt @@ -223,11 +223,16 @@ abstract class Keyoapp( // Image list override fun pageListParse(document: Document): List { - return document.select("#pages > img:not(.hidden)").mapIndexed { index, img -> - Page(index, document.location(), img.imgAttr()) - } + return document.select("#pages > img") + .map { it.imgAttr() } + .filter { it.contains(imgCdnRegex) } + .mapIndexed { index, img -> + Page(index, document.location(), img) + } } + private val imgCdnRegex = Regex("""^(https?:)?//cdn\d*\.keyoapp\.com""") + override fun imageUrlParse(document: Document) = "" // Utilities