From 915b00b761d60e812626e0d0d47906210ced21db Mon Sep 17 00:00:00 2001 From: stevenyomi <95685115+stevenyomi@users.noreply.github.com> Date: Thu, 26 Jan 2023 02:45:53 +0800 Subject: [PATCH] Everia.club: fix image URL parsing (#15094) --- src/all/everiaclub/build.gradle | 2 +- .../tachiyomi/extension/all/everiaclub/EveriaClub.kt | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/all/everiaclub/build.gradle b/src/all/everiaclub/build.gradle index cf0605b06..965582528 100644 --- a/src/all/everiaclub/build.gradle +++ b/src/all/everiaclub/build.gradle @@ -5,7 +5,7 @@ ext { extName = 'Everia.club' pkgNameSuffix = 'all.everiaclub' extClass = '.EveriaClub' - extVersionCode = 5 + extVersionCode = 6 isNsfw = true } diff --git a/src/all/everiaclub/src/eu/kanade/tachiyomi/extension/all/everiaclub/EveriaClub.kt b/src/all/everiaclub/src/eu/kanade/tachiyomi/extension/all/everiaclub/EveriaClub.kt index 0e316597a..c04be8920 100644 --- a/src/all/everiaclub/src/eu/kanade/tachiyomi/extension/all/everiaclub/EveriaClub.kt +++ b/src/all/everiaclub/src/eu/kanade/tachiyomi/extension/all/everiaclub/EveriaClub.kt @@ -22,10 +22,15 @@ class EveriaClub() : ParsedHttpSource() { override fun headersBuilder() = super.headersBuilder() .add("Referer", "$baseUrl/") + private val Element.imgSrc: String + get() = attr("data-lazy-src") + .ifEmpty { attr("data-src") } + .ifEmpty { attr("src") } + // Latest override fun latestUpdatesFromElement(element: Element): SManga { 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.setUrlWithoutDomain(element.select(".entry-title > a").attr("abs:href")) return manga @@ -41,7 +46,7 @@ class EveriaClub() : ParsedHttpSource() { // Popular override fun popularMangaFromElement(element: Element): SManga { 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.setUrlWithoutDomain(element.select("h3 > a").attr("abs:href")) return manga @@ -98,8 +103,9 @@ class EveriaClub() : ParsedHttpSource() { // Pages override fun pageListParse(document: Document): List { val pages = mutableListOf() + document.select("noscript").remove() 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)) } return pages