Komik Cast - Fix match result return null (not found) (#12164)

* Komik Cast - Fix match result return null (not found)

* Komik Cast - Updating overrideVersionCode
This commit is contained in:
(e)x(otic) Ne(e)t 2022-06-12 21:14:10 +07:00 committed by GitHub
parent a561eaa219
commit 3f01076936
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 8 deletions

View File

@ -157,16 +157,23 @@ class KomikCast : WPMangaStream("Komik Cast", "https://komikcast.me", "id") {
}
override fun pageListParse(document: Document): List<Page> {
var doc = document
var cssQuery = "div#chapter_body .main-reading-area img.size-full"
val imageListRegex = Regex("chapterImages = (.*) \\|\\|")
val imageListJson = imageListRegex.find(document.toString())!!.destructured.toList()[0]
val imageList = json.parseToJsonElement(imageListJson).jsonObject
val imageListMatchResult = imageListRegex.find(document.toString())
var imageServer = "cdn"
if (!imageList.containsKey(imageServer)) imageServer = imageList.keys.first()
val imageElement = imageList[imageServer]!!.jsonArray.joinToString("")
val doc = Jsoup.parse(json.decodeFromString(imageElement))
if (imageListMatchResult != null) {
val imageListJson = imageListMatchResult.destructured.toList()[0]
val imageList = json.parseToJsonElement(imageListJson).jsonObject
return doc.select("img.size-full")
var imageServer = "cdn"
if (!imageList.containsKey(imageServer)) imageServer = imageList.keys.first()
val imageElement = imageList[imageServer]!!.jsonArray.joinToString("")
doc = Jsoup.parse(json.decodeFromString(imageElement))
cssQuery = "img.size-full"
}
return doc.select(cssQuery)
.mapIndexed { i, img -> Page(i, "", img.attr("abs:Src")) }
}

View File

@ -22,7 +22,7 @@ class WPMangaStreamGenerator : ThemeSourceGenerator {
SingleLang("Kanzenin", "https://kanzenin.xyz", "id", isNsfw = true),
SingleLang("KlanKomik", "https://klankomik.com", "id", overrideVersionCode = 1),
SingleLang("Komik AV", "https://komikav.com", "id", overrideVersionCode = 1),
SingleLang("Komik Cast", "https://komikcast.me", "id", overrideVersionCode = 11),
SingleLang("Komik Cast", "https://komikcast.me", "id", overrideVersionCode = 12),
SingleLang("Komik Station", "https://komikstation.co", "id", overrideVersionCode = 3),
SingleLang("KomikIndo.co", "https://komikindo.co", "id", className = "KomikindoCo", overrideVersionCode = 3),
SingleLang("Kuma Scans (Kuma Translation)", "https://kumascans.com", "en", className = "KumaScans", overrideVersionCode = 1),