[Madara] Fix multiple pages handling

This commit is contained in:
2024-10-09 17:18:48 +03:00
parent 5c55d65eb3
commit ce9404da84

View File

@@ -678,15 +678,16 @@ internal abstract class MadaraParser(
"No image found, try to log in",
fullUrl,
)
return root.select(selectPage).map { div ->
val img = div.selectFirstOrThrow("img")
val url = img.src()?.toRelativeUrl(domain) ?: div.parseFailed("Image src not found")
MangaPage(
id = generateUid(url),
url = url,
preview = null,
source = source,
)
return root.select(selectPage).flatMap { div ->
div.selectOrThrow("img").map { img ->
val url = img.src()?.toRelativeUrl(domain) ?: div.parseFailed("Image src not found")
MangaPage(
id = generateUid(url),
url = url,
preview = null,
source = source,
)
}
}
}
} else {