rs fix for mobile User Agent (#15847)

This commit is contained in:
Henrik 2023-03-28 15:33:15 +02:00 committed by GitHub
parent 0318ea6cdd
commit 8f340df01b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 2 deletions

View File

@ -6,7 +6,7 @@ ext {
extName = 'Reaper Scans'
pkgNameSuffix = 'en.reaperscans'
extClass = '.ReaperScans'
extVersionCode = 42
extVersionCode = 43
}
apply from: "$rootDir/common.gradle"

View File

@ -276,8 +276,9 @@ class ReaperScans : ParsedHttpSource() {
// Page
override fun pageListParse(document: Document): List<Page> {
document.select("noscript").remove()
return document.select("img.max-w-full").mapIndexed { index, element ->
Page(index, imageUrl = element.attr("abs:src"))
Page(index, imageUrl = element.imgAttr())
}
}
@ -325,6 +326,13 @@ class ReaperScans : ParsedHttpSource() {
}
}
fun Element.imgAttr(): String = when {
hasAttr("data-lazy-src") -> attr("abs:data-lazy-src")
hasAttr("data-src") -> attr("abs:data-src")
hasAttr("data-cfsrc") -> attr("abs:data-cfsrc")
else -> attr("abs:src")
}
// Unused
override fun searchMangaNextPageSelector() = throw UnsupportedOperationException("Not Used")