Skip to content

Commit

Permalink
[Madara] Fix multiple pages handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Koitharu committed Oct 9, 2024
1 parent 5c55d65 commit ce9404d
Showing 1 changed file with 10 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit ce9404d

Please sign in to comment.