APairOf2+ : fix lazy loaded images (#15872)
* po2scans: fix lazy loaded images * bump
This commit is contained in:
parent
70395f46c1
commit
5d08b87c31
|
@ -5,7 +5,7 @@ ext {
|
|||
extName = 'A Pair of 2+'
|
||||
pkgNameSuffix = 'en.apairof2'
|
||||
extClass = '.APairOf2'
|
||||
extVersionCode = 29
|
||||
extVersionCode = 30
|
||||
}
|
||||
|
||||
apply from: "$rootDir/common.gradle"
|
||||
|
|
|
@ -136,11 +136,16 @@ class APairOf2 : ParsedHttpSource() {
|
|||
return document.select(".swiper-slide img").mapIndexed { index, img ->
|
||||
Page(
|
||||
index = index,
|
||||
imageUrl = img.attr("src").let { "$baseUrl/$it" },
|
||||
imageUrl = img.imgAttr()
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
private fun Element.imgAttr(): String = when {
|
||||
hasAttr("data-pagespeed-lazy-src") -> attr("abs:data-pagespeed-lazy-src")
|
||||
else -> attr("abs:src")
|
||||
}
|
||||
|
||||
override fun imageUrlParse(document: Document): String {
|
||||
throw UnsupportedOperationException("not used")
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue