Everia.club: fix image URL parsing (#15094)

This commit is contained in:
stevenyomi 2023-01-26 02:45:53 +08:00 committed by GitHub
parent b20817f7b5
commit 915b00b761
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 4 deletions

View File

@ -5,7 +5,7 @@ ext {
extName = 'Everia.club' extName = 'Everia.club'
pkgNameSuffix = 'all.everiaclub' pkgNameSuffix = 'all.everiaclub'
extClass = '.EveriaClub' extClass = '.EveriaClub'
extVersionCode = 5 extVersionCode = 6
isNsfw = true isNsfw = true
} }

View File

@ -22,10 +22,15 @@ class EveriaClub() : ParsedHttpSource() {
override fun headersBuilder() = super.headersBuilder() override fun headersBuilder() = super.headersBuilder()
.add("Referer", "$baseUrl/") .add("Referer", "$baseUrl/")
private val Element.imgSrc: String
get() = attr("data-lazy-src")
.ifEmpty { attr("data-src") }
.ifEmpty { attr("src") }
// Latest // Latest
override fun latestUpdatesFromElement(element: Element): SManga { override fun latestUpdatesFromElement(element: Element): SManga {
val manga = SManga.create() val manga = SManga.create()
manga.thumbnail_url = element.select("img").attr("abs:src") manga.thumbnail_url = element.selectFirst("img").imgSrc
manga.title = element.select(".entry-title").text() manga.title = element.select(".entry-title").text()
manga.setUrlWithoutDomain(element.select(".entry-title > a").attr("abs:href")) manga.setUrlWithoutDomain(element.select(".entry-title > a").attr("abs:href"))
return manga return manga
@ -41,7 +46,7 @@ class EveriaClub() : ParsedHttpSource() {
// Popular // Popular
override fun popularMangaFromElement(element: Element): SManga { override fun popularMangaFromElement(element: Element): SManga {
val manga = SManga.create() val manga = SManga.create()
manga.thumbnail_url = element.select("img").attr("abs:src") manga.thumbnail_url = element.selectFirst("img").imgSrc
manga.title = element.select("h3").text() manga.title = element.select("h3").text()
manga.setUrlWithoutDomain(element.select("h3 > a").attr("abs:href")) manga.setUrlWithoutDomain(element.select("h3 > a").attr("abs:href"))
return manga return manga
@ -98,8 +103,9 @@ class EveriaClub() : ParsedHttpSource() {
// Pages // Pages
override fun pageListParse(document: Document): List<Page> { override fun pageListParse(document: Document): List<Page> {
val pages = mutableListOf<Page>() val pages = mutableListOf<Page>()
document.select("noscript").remove()
document.select("article img").forEachIndexed { i, it -> document.select("article img").forEachIndexed { i, it ->
val itUrl = it.attr("data-src").ifEmpty { it.attr("src") } val itUrl = it.imgSrc
pages.add(Page(i, itUrl, itUrl)) pages.add(Page(i, itUrl, itUrl))
} }
return pages return pages