MangaGeko: Fix missing images in getPages (#2267)

master
Draken 7 months ago committed by GitHub
parent d9025dbf81
commit a5233ede48
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -159,12 +159,15 @@ internal class MangaGeko(context: MangaLoaderContext) :
override suspend fun getPages(chapter: MangaChapter): List<MangaPage> { override suspend fun getPages(chapter: MangaChapter): List<MangaPage> {
val fullUrl = chapter.url.toAbsoluteUrl(domain) val fullUrl = chapter.url.toAbsoluteUrl(domain)
val doc = webClient.httpGet(fullUrl).parseHtml() val doc = webClient.httpGet(fullUrl).parseHtml()
return doc.select("center img")
return doc.requireElementById("chapter-reader").select("img").map { img -> .mapNotNull { it.attr("src").takeIf { src -> src.isNotBlank() } }
val url = img.requireSrc().toRelativeUrl(domain) // remove all invaild images + credits
.filterNot { it.startsWith("data:image") || it.contains("credits-mgeko.png") }
.distinct().map { url ->
val finalUrl = url.toRelativeUrl(domain)
MangaPage( MangaPage(
id = generateUid(url), id = generateUid(finalUrl),
url = url, url = finalUrl,
preview = null, preview = null,
source = source, source = source,
) )

Loading…
Cancel
Save