LeerCapitulo: Fix page order (#16073)

Fix image order
This commit is contained in:
seew3l 2023-04-16 18:12:40 -05:00 committed by GitHub
parent 8670d2c9da
commit 4a20984161
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View File

@ -6,7 +6,7 @@ ext {
extName = 'LeerCapitulo / OlympusScan.top'
pkgNameSuffix = 'es.leercapitulo'
extClass = '.LeerCapitulo'
extVersionCode = 2
extVersionCode = 3
}
apply from: "$rootDir/common.gradle"

View File

@ -147,8 +147,13 @@ class LeerCapitulo : ParsedHttpSource(), ConfigurableSource {
// Pages
override fun pageListParse(document: Document): List<Page> {
val order = document.selectFirst("meta[property=ad:check]")?.attr("content")
?.replace("[^\\d]+".toRegex(), "-")
?.split("-")
val urls = document.selectFirst("#arraydata")!!.text().split(',')
return urls.mapIndexed { i, image_url ->
val sortedUrl = order?.map { urls[it.toInt()] } ?: urls
return sortedUrl.mapIndexed { i, image_url ->
Page(i, imageUrl = image_url.replace("https://cdn.statically.io/img/", "https://")) // just redirects
}
}