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

@ -156,18 +156,21 @@ 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
MangaPage( .filterNot { it.startsWith("data:image") || it.contains("credits-mgeko.png") }
id = generateUid(url), .distinct().map { url ->
url = url, val finalUrl = url.toRelativeUrl(domain)
preview = null, MangaPage(
source = source, id = generateUid(finalUrl),
) url = finalUrl,
} preview = null,
} source = source,
)
}
}
} }

Loading…
Cancel
Save