diff --git a/src/zh/jinmantiantang/build.gradle b/src/zh/jinmantiantang/build.gradle index 0ddb4e405..114b236b5 100644 --- a/src/zh/jinmantiantang/build.gradle +++ b/src/zh/jinmantiantang/build.gradle @@ -1,7 +1,7 @@ ext { extName = 'Jinman Tiantang' extClass = '.Jinmantiantang' - extVersionCode = 41 + extVersionCode = 42 isNsfw = true } diff --git a/src/zh/jinmantiantang/src/eu/kanade/tachiyomi/extension/zh/jinmantiantang/Jinmantiantang.kt b/src/zh/jinmantiantang/src/eu/kanade/tachiyomi/extension/zh/jinmantiantang/Jinmantiantang.kt index cdfec4234..4b2feaba9 100644 --- a/src/zh/jinmantiantang/src/eu/kanade/tachiyomi/extension/zh/jinmantiantang/Jinmantiantang.kt +++ b/src/zh/jinmantiantang/src/eu/kanade/tachiyomi/extension/zh/jinmantiantang/Jinmantiantang.kt @@ -80,7 +80,7 @@ class Jinmantiantang : ParsedHttpSource(), ConfigurableSource { title = children[1].text() setUrlWithoutDomain(children[0].selectFirst("a")!!.attr("href")) val img = children[0].selectFirst("img")!! - thumbnail_url = img.attr("data-original").ifEmpty { img.attr("src") }.substringBeforeLast('?') + thumbnail_url = img.extractThumbnailUrl().substringBeforeLast('?') author = children[2].select("a").joinToString(", ") { it.text() } genre = children[3].select("a").joinToString(", ") { it.text() } } @@ -166,7 +166,7 @@ class Jinmantiantang : ParsedHttpSource(), ConfigurableSource { override fun mangaDetailsParse(document: Document): SManga = SManga.create().apply { title = document.selectFirst("h1")!!.text() // keep thumbnail_url same as the one in popularMangaFromElement() - thumbnail_url = document.selectFirst(".thumb-overlay > img")!!.attr("src").substringBeforeLast('.') + "_3x4.jpg" + thumbnail_url = document.selectFirst(".thumb-overlay > img")!!.extractThumbnailUrl().substringBeforeLast('.') + "_3x4.jpg" author = selectAuthor(document) genre = selectDetailsStatusAndGenre(document, 0).trim().split(" ").joinToString(", ") @@ -176,6 +176,15 @@ class Jinmantiantang : ParsedHttpSource(), ConfigurableSource { description = document.selectFirst("#intro-block .p-t-5.p-b-5")!!.text().substringAfter("敘述:").trim() } + private fun Element.extractThumbnailUrl(): String { + return when { + hasAttr("data-original") -> attr("data-original") + hasAttr("src") -> attr("src") + hasAttr("data-cfsrc") -> attr("data-cfsrc") + else -> "" + } + } + // 查询作者信息 private fun selectAuthor(document: Document): String { val element = document.select("div.panel-body div.tag-block")[3]