Readmangas: Fixed to the pagination of the chapters and the domain (#6725)

Fix return type in pageListParse to List<Page> to match method signature
This commit is contained in:
alberlandohc 2024-12-22 12:19:08 -03:00 committed by Draff
parent 34abdec28c
commit caf440aaa2
No known key found for this signature in database
GPG Key ID: E8A89F3211677653
2 changed files with 6 additions and 7 deletions

View File

@ -1,7 +1,7 @@
ext {
extName = 'Read Mangas'
extClass = '.ReadMangas'
extVersionCode = 32
extVersionCode = 33
}
apply from: "$rootDir/common.gradle"

View File

@ -32,7 +32,7 @@ class ReadMangas() : HttpSource() {
override val name = "Read Mangas"
override val baseUrl = "https://readmangas.org"
override val baseUrl = "https://app.loobyt.com"
override val lang = "pt-BR"
@ -247,13 +247,12 @@ class ReadMangas() : HttpSource() {
override fun pageListParse(response: Response): List<Page> {
val document = response.asJsoup()
val script = document.select("script").map { it.data() }
.firstOrNull { IMAGE_URL_REGEX.containsMatchIn(it) }
?: return emptyList()
return IMAGE_URL_REGEX.findAll(script).mapIndexed { index, match ->
val scripts = document.select("script").joinToString("\n") { it.data() }
val pages = IMAGE_URL_REGEX.findAll(scripts).mapIndexed { index, match ->
Page(index, imageUrl = match.groups["imageUrl"]!!.value)
}.toList()
return pages
}
override fun imageUrlParse(response: Response) = ""