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:
parent
88279ca67a
commit
4705fb8ef1
@ -5,7 +5,7 @@ ext {
|
|||||||
extName = 'NewToki'
|
extName = 'NewToki'
|
||||||
pkgNameSuffix = 'ko.newtoki'
|
pkgNameSuffix = 'ko.newtoki'
|
||||||
extClass = '.NewTokiFactory'
|
extClass = '.NewTokiFactory'
|
||||||
extVersionCode = 12
|
extVersionCode = 13
|
||||||
libVersion = '1.2'
|
libVersion = '1.2'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -77,6 +77,7 @@ open class NewToki(override val name: String, private val defaultBaseUrl: String
|
|||||||
override fun mangaDetailsParse(document: Document): SManga {
|
override fun mangaDetailsParse(document: Document): SManga {
|
||||||
val info = document.select("div.view-title > .view-content").first()
|
val info = document.select("div.view-title > .view-content").first()
|
||||||
val title = document.select("div.view-content > span > b").text()
|
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 descriptionElement = info.select("div.row div.view-content:not([style])")
|
||||||
val description = descriptionElement.map {
|
val description = descriptionElement.map {
|
||||||
it.text().trim()
|
it.text().trim()
|
||||||
@ -85,6 +86,7 @@ open class NewToki(override val name: String, private val defaultBaseUrl: String
|
|||||||
val manga = SManga.create()
|
val manga = SManga.create()
|
||||||
manga.title = title
|
manga.title = title
|
||||||
manga.description = description.joinToString("\n")
|
manga.description = description.joinToString("\n")
|
||||||
|
manga.thumbnail_url = thumbnail
|
||||||
descriptionElement.forEach {
|
descriptionElement.forEach {
|
||||||
val text = it.text()
|
val text = it.text()
|
||||||
when {
|
when {
|
||||||
@ -164,8 +166,8 @@ open class NewToki(override val name: String, private val defaultBaseUrl: String
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun pageListParse(document: Document): List<Page> {
|
override fun pageListParse(document: Document): List<Page> {
|
||||||
return document.select("article > div > div > img")
|
return document.select("article > div div > img")
|
||||||
.filterNot { it.attr("data-original").contains("blank.gif") }
|
.filterNot { !it.hasAttr("data-original") || it.attr("data-original").contains("blank.gif") }
|
||||||
.mapIndexed { i, img -> Page(i, "", img.attr("abs:data-original")) }
|
.mapIndexed { i, img -> Page(i, "", img.attr("abs:data-original")) }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user