KomikCast: Fix duplicate images (#3434)
This commit is contained in:
parent
fc316415eb
commit
25c9212526
|
@ -3,7 +3,7 @@ ext {
|
|||
extClass = '.KomikCast'
|
||||
themePkg = 'mangathemesia'
|
||||
baseUrl = 'https://komikcast.lol'
|
||||
overrideVersionCode = 26
|
||||
overrideVersionCode = 27
|
||||
}
|
||||
|
||||
apply from: "$rootDir/common.gradle"
|
||||
|
|
|
@ -8,13 +8,10 @@ import eu.kanade.tachiyomi.source.model.FilterList
|
|||
import eu.kanade.tachiyomi.source.model.Page
|
||||
import eu.kanade.tachiyomi.source.model.SChapter
|
||||
import eu.kanade.tachiyomi.source.model.SManga
|
||||
import kotlinx.serialization.json.jsonArray
|
||||
import kotlinx.serialization.json.jsonObject
|
||||
import okhttp3.Headers
|
||||
import okhttp3.HttpUrl.Companion.toHttpUrl
|
||||
import okhttp3.OkHttpClient
|
||||
import okhttp3.Request
|
||||
import org.jsoup.Jsoup
|
||||
import org.jsoup.nodes.Document
|
||||
import org.jsoup.nodes.Element
|
||||
import java.util.Calendar
|
||||
|
@ -141,23 +138,8 @@ class KomikCast : MangaThemesia("Komik Cast", "https://komikcast.lol", "id", "/d
|
|||
}
|
||||
|
||||
override fun pageListParse(document: Document): List<Page> {
|
||||
var doc = document
|
||||
var cssQuery = "div#chapter_body .main-reading-area img"
|
||||
val imageListRegex = Regex("chapterImages = (.*) \\|\\|")
|
||||
val imageListMatchResult = imageListRegex.find(document.toString())
|
||||
|
||||
if (imageListMatchResult != null) {
|
||||
val imageListJson = imageListMatchResult.destructured.toList()[0]
|
||||
val imageList = json.parseToJsonElement(imageListJson).jsonObject
|
||||
|
||||
var imageServer = "cdn"
|
||||
if (!imageList.containsKey(imageServer)) imageServer = imageList.keys.first()
|
||||
val imageElement = imageList[imageServer]!!.jsonArray.joinToString("")
|
||||
doc = Jsoup.parse(imageElement)
|
||||
cssQuery = "img.size-full"
|
||||
}
|
||||
|
||||
return doc.select(cssQuery)
|
||||
return document.select("div#chapter_body .main-reading-area img.size-full")
|
||||
.distinctBy { img -> img.imgAttr() }
|
||||
.mapIndexed { i, img -> Page(i, document.location(), img.imgAttr()) }
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue