mirror of
https://github.com/keiyoushi/extensions-source.git
synced 2024-11-25 03:33:24 +01:00
parent
300729019b
commit
d0bd99abf1
@ -2,7 +2,7 @@ plugins {
|
||||
id("lib-multisrc")
|
||||
}
|
||||
|
||||
baseVersionCode = 5
|
||||
baseVersionCode = 6
|
||||
|
||||
dependencies {
|
||||
compileOnly("com.github.tachiyomiorg:image-decoder:e08e9be535")
|
||||
|
@ -153,13 +153,16 @@ abstract class PeachScan(
|
||||
}.getOrDefault(0L)
|
||||
}
|
||||
|
||||
private val urlsRegex = """const\s+urls\s*=\s*\[(.*?)]\s*;""".toRegex()
|
||||
|
||||
override fun pageListParse(document: Document): List<Page> {
|
||||
val scriptElement = document.selectFirst("script:containsData(const urls =[)")
|
||||
val scriptElement = document.selectFirst("script:containsData(const urls)")
|
||||
?: return document.select("#imageContainer img").mapIndexed { i, it ->
|
||||
Page(i, document.location(), it.attr("abs:src"))
|
||||
}
|
||||
|
||||
val urls = scriptElement.html().substringAfter("const urls =[").substringBefore("];")
|
||||
val urls = urlsRegex.find(scriptElement.data())?.groupValues?.get(1)
|
||||
?: throw Exception("Could not find image URLs")
|
||||
|
||||
return urls.split(",").mapIndexed { i, it ->
|
||||
Page(i, document.location(), baseUrl + it.trim().removeSurrounding("'") + "#page")
|
||||
|
Loading…
Reference in New Issue
Block a user