imhentai fix thumbnails (#14596)

This commit is contained in:
Basara-Hatake 2022-12-19 18:13:29 +01:00 committed by GitHub
parent 733555b9b3
commit 3b45323695
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 3 deletions

View File

@ -5,7 +5,7 @@ ext {
extName = 'IMHentai' extName = 'IMHentai'
pkgNameSuffix = 'all.imhentai' pkgNameSuffix = 'all.imhentai'
extClass = '.IMHentaiFactory' extClass = '.IMHentaiFactory'
extVersionCode = 9 extVersionCode = 10
isNsfw = true isNsfw = true
} }

View File

@ -54,7 +54,9 @@ class IMHentai(override val lang: String, private val imhLang: String) : ParsedH
override fun popularMangaFromElement(element: Element): SManga { override fun popularMangaFromElement(element: Element): SManga {
return SManga.create().apply { return SManga.create().apply {
thumbnail_url = element.select(".inner_thumb img").attr("data-src") thumbnail_url = element.selectFirst(".inner_thumb img")?.let {
it.absUrl(if (it.hasAttr("data-src")) "data-src" else "src")
}
with(element.select(".caption a")) { with(element.select(".caption a")) {
url = this.attr("href") url = this.attr("href")
title = this.text() title = this.text()
@ -152,7 +154,9 @@ class IMHentai(override val lang: String, private val imhLang: String) : ParsedH
title = document.selectFirst("div.right_details > h1").text() title = document.selectFirst("div.right_details > h1").text()
thumbnail_url = document.selectFirst("div.left_cover img").attr("abs:data-src") thumbnail_url = document.selectFirst("div.left_cover img")?.let {
it.absUrl(if (it.hasAttr("data-src")) "data-src" else "src")
}
val mangaInfoElement = document.select(".galleries_info") val mangaInfoElement = document.select(".galleries_info")
val infoMap = mangaInfoElement.select("li:not(.pages)").map { val infoMap = mangaInfoElement.select("li:not(.pages)").map {