APairOf2+ : fix lazy loaded images (#15872)

* po2scans: fix lazy loaded images

* bump
This commit is contained in:
mobi2002 2023-03-28 18:36:06 +05:00 committed by GitHub
parent 70395f46c1
commit 5d08b87c31
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View File

@ -5,7 +5,7 @@ ext {
extName = 'A Pair of 2+' extName = 'A Pair of 2+'
pkgNameSuffix = 'en.apairof2' pkgNameSuffix = 'en.apairof2'
extClass = '.APairOf2' extClass = '.APairOf2'
extVersionCode = 29 extVersionCode = 30
} }
apply from: "$rootDir/common.gradle" apply from: "$rootDir/common.gradle"

View File

@ -136,11 +136,16 @@ class APairOf2 : ParsedHttpSource() {
return document.select(".swiper-slide img").mapIndexed { index, img -> return document.select(".swiper-slide img").mapIndexed { index, img ->
Page( Page(
index = index, 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 { override fun imageUrlParse(document: Document): String {
throw UnsupportedOperationException("not used") throw UnsupportedOperationException("not used")
} }