Keyoapp: filter dummy pages (#3081)

This commit is contained in:
AwkwardPeak7 2024-05-17 16:28:48 +05:00 committed by Draff
parent b1c691394c
commit 6c5462309d
2 changed files with 9 additions and 4 deletions

View File

@ -2,4 +2,4 @@ plugins {
id("lib-multisrc")
}
baseVersionCode = 3
baseVersionCode = 4

View File

@ -223,11 +223,16 @@ abstract class Keyoapp(
// Image list
override fun pageListParse(document: Document): List<Page> {
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