Fix issue with old manga on Newtoki's .net domain + thumbnails (#4241)

* Fix issue with old manga on Newtoki's .net domain + thumbnails

* This is how IntelliJ works
This commit is contained in:
DitFranXX 2020-08-29 10:37:13 +09:00 committed by GitHub
parent 88279ca67a
commit 4705fb8ef1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View File

@ -5,7 +5,7 @@ ext {
extName = 'NewToki'
pkgNameSuffix = 'ko.newtoki'
extClass = '.NewTokiFactory'
extVersionCode = 12
extVersionCode = 13
libVersion = '1.2'
}

View File

@ -77,6 +77,7 @@ open class NewToki(override val name: String, private val defaultBaseUrl: String
override fun mangaDetailsParse(document: Document): SManga {
val info = document.select("div.view-title > .view-content").first()
val title = document.select("div.view-content > span > b").text()
val thumbnail = document.select("div.row div.view-img > img").attr("src")
val descriptionElement = info.select("div.row div.view-content:not([style])")
val description = descriptionElement.map {
it.text().trim()
@ -85,6 +86,7 @@ open class NewToki(override val name: String, private val defaultBaseUrl: String
val manga = SManga.create()
manga.title = title
manga.description = description.joinToString("\n")
manga.thumbnail_url = thumbnail
descriptionElement.forEach {
val text = it.text()
when {
@ -164,8 +166,8 @@ open class NewToki(override val name: String, private val defaultBaseUrl: String
}
override fun pageListParse(document: Document): List<Page> {
return document.select("article > div > div > img")
.filterNot { it.attr("data-original").contains("blank.gif") }
return document.select("article > div div > img")
.filterNot { !it.hasAttr("data-original") || it.attr("data-original").contains("blank.gif") }
.mapIndexed { i, img -> Page(i, "", img.attr("abs:data-original")) }
}