Update Newtoki Extension v1.2.17 (#4423)
Update Newtoki Extension v1.2.17
This commit is contained in:
parent
8143b34bf0
commit
df84417403
@ -5,7 +5,7 @@ ext {
|
|||||||
extName = 'NewToki / ManaToki(ManaMoa)'
|
extName = 'NewToki / ManaToki(ManaMoa)'
|
||||||
pkgNameSuffix = 'ko.newtoki'
|
pkgNameSuffix = 'ko.newtoki'
|
||||||
extClass = '.NewTokiFactory'
|
extClass = '.NewTokiFactory'
|
||||||
extVersionCode = 16
|
extVersionCode = 17
|
||||||
libVersion = '1.2'
|
libVersion = '1.2'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -209,7 +209,9 @@ open class NewToki(override val name: String, private val defaultBaseUrl: String
|
|||||||
private val htmlDataRegex = Regex("""html_data\+='([^']+)'""")
|
private val htmlDataRegex = Regex("""html_data\+='([^']+)'""")
|
||||||
|
|
||||||
override fun pageListParse(document: Document): List<Page> {
|
override fun pageListParse(document: Document): List<Page> {
|
||||||
val script = document.select("script:containsData(html_data)").firstOrNull()?.data() ?: throw Exception("script not found")
|
val script = document.select("script:containsData(html_data)").firstOrNull()?.data() ?: throw Exception("data script not found")
|
||||||
|
val loadScript = document.select("script:containsData(data_attribute)").firstOrNull()?.data() ?: throw Exception("load script not found")
|
||||||
|
val dataAttr = "abs:data-" + loadScript.substringAfter("data_attribute: '").substringBefore("',")
|
||||||
|
|
||||||
return htmlDataRegex.findAll(script).map { it.groupValues[1] }
|
return htmlDataRegex.findAll(script).map { it.groupValues[1] }
|
||||||
.asIterable()
|
.asIterable()
|
||||||
@ -217,7 +219,7 @@ open class NewToki(override val name: String, private val defaultBaseUrl: String
|
|||||||
.joinToString("") { it.toIntOrNull(16)?.toChar()?.toString() ?: "" }
|
.joinToString("") { it.toIntOrNull(16)?.toChar()?.toString() ?: "" }
|
||||||
.let { Jsoup.parse(it) }
|
.let { Jsoup.parse(it) }
|
||||||
.select("img[alt]")
|
.select("img[alt]")
|
||||||
.mapIndexed { i, img -> Page(i, "", if (img.hasAttr("abs:data-original")) img.attr("abs:data-original") else img.attr("abs:content")) }
|
.mapIndexed { i, img -> Page(i, "", if (img.hasAttr(dataAttr)) img.attr(dataAttr) else img.attr("abs:content")) }
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun latestUpdatesSelector() = popularMangaSelector()
|
override fun latestUpdatesSelector() = popularMangaSelector()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user