fix liliana page order (#2473)
This commit is contained in:
parent
0e20357684
commit
4030cebbbf
|
@ -2,4 +2,4 @@ plugins {
|
|||
id("lib-multisrc")
|
||||
}
|
||||
|
||||
baseVersionCode = 1
|
||||
baseVersionCode = 2
|
||||
|
|
|
@ -322,10 +322,18 @@ abstract class Liliana(
|
|||
}
|
||||
|
||||
override fun pageListParse(document: Document): List<Page> {
|
||||
return document.select("div.separator").mapIndexed { i, page ->
|
||||
return if (document.selectFirst("div.separator[data-index]") == null) {
|
||||
document.select("div.separator").mapIndexed { i, page ->
|
||||
val url = page.selectFirst("a")!!.attr("abs:href")
|
||||
Page(i, document.location(), url)
|
||||
}
|
||||
} else {
|
||||
document.select("div.separator[data-index]").map { page ->
|
||||
val index = page.attr("data-index").toInt()
|
||||
val url = page.selectFirst("a")!!.attr("abs:href")
|
||||
Page(index, document.location(), url)
|
||||
}.sortedBy { it.index }
|
||||
}
|
||||
}
|
||||
|
||||
override fun imageUrlParse(document: Document) = ""
|
||||
|
|
|
@ -1,15 +1,18 @@
|
|||
package eu.kanade.tachiyomi.extension.ja.mangakoma
|
||||
|
||||
import eu.kanade.tachiyomi.multisrc.liliana.Liliana
|
||||
import eu.kanade.tachiyomi.network.GET
|
||||
import eu.kanade.tachiyomi.source.model.Page
|
||||
import org.jsoup.nodes.Document
|
||||
import okhttp3.HttpUrl.Companion.toHttpUrl
|
||||
import okhttp3.Request
|
||||
|
||||
class MangaKoma : Liliana("Manga Koma", "https://mangakoma01.net", "ja") {
|
||||
override fun pageListParse(document: Document): List<Page> {
|
||||
return document.select("div.separator[data-index]").map { page ->
|
||||
val index = page.attr("data-index").toInt()
|
||||
val url = page.selectFirst("a")!!.attr("abs:href")
|
||||
Page(index, document.location(), url)
|
||||
}.sortedBy { it.index }
|
||||
override fun imageRequest(page: Page): Request {
|
||||
val imgHeaders = headersBuilder().apply {
|
||||
add("Accept", "image/avif,image/webp,*/*")
|
||||
add("Host", page.imageUrl!!.toHttpUrl().host)
|
||||
removeAll("Referer")
|
||||
}.build()
|
||||
return GET(page.imageUrl!!, imgHeaders)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue