v5
Build Futon with Niadd patch / Build Futon Niadd debug APK (push) Successful in 5m40s

This commit is contained in:
gandc committed 2026-08-11 22:15:12 +03:00
1 parent 7c63edc664
commit bbccd48bd6
2 files changed
+95 -43

No files matched your search

+3 -21
View File
@@ -767,27 +767,9 @@ replace_exact(
)
}
/*
* Fallback in case Niadd removes the "N of M"
* image link but leaves the actual image element.
*/
val imageUrlRegex = Regex(
"""(?i)\\.(?:jpe?g|png|gif|webp|avif)(?:\\?|$)"""
)
val image = root
.select("img[src]")
.firstOrNull { element ->
val src = element.attr("src")
imageUrlRegex.containsMatchIn(src) &&
!src.contains("logo", ignoreCase = true) &&
!src.contains("avatar", ignoreCase = true)
}
if (image != null) {
return image.attrAsAbsoluteUrl("src")
}
// Do not fall back to an arbitrary <img>. Niadd may return a
// service/notice page with a perfectly valid static image, which
// would otherwise be cached as every manga page.
error(
"Cannot find Niadd reader image for ${page.url}"