|
|
|
@ -194,10 +194,7 @@ internal class CMangaParser(context: MangaLoaderContext) :
|
|
|
|
throw IllegalStateException("This chapter is locked, you would need to buy it from website")
|
|
|
|
throw IllegalStateException("This chapter is locked, you would need to buy it from website")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return pageResponse.getJSONArray("image")
|
|
|
|
return pageResponse.getJSONArray("image").asTypedList<String>().map {
|
|
|
|
.asTypedList<String>()
|
|
|
|
|
|
|
|
.filterNot(::containsAdsUrl)
|
|
|
|
|
|
|
|
.map {
|
|
|
|
|
|
|
|
MangaPage(
|
|
|
|
MangaPage(
|
|
|
|
id = generateUid(it),
|
|
|
|
id = generateUid(it),
|
|
|
|
url = it,
|
|
|
|
url = it,
|
|
|
|
@ -223,19 +220,9 @@ internal class CMangaParser(context: MangaLoaderContext) :
|
|
|
|
return tags
|
|
|
|
return tags
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private fun JSONObject.parseJson(key: String): JSONObject {
|
|
|
|
|
|
|
|
return JSONObject(getString(key))
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private fun JSONObject.isLocked() = opt("lock") != null
|
|
|
|
private fun JSONObject.isLocked() = opt("lock") != null
|
|
|
|
|
|
|
|
|
|
|
|
private fun containsAdsUrl(url: String): Boolean {
|
|
|
|
private fun JSONObject.parseJson(key: String): JSONObject {
|
|
|
|
val adsUrl = "https://img.cmangapi.com/data-image/index.php"
|
|
|
|
return JSONObject(getString(key))
|
|
|
|
val cleanUrl = url.replace("\\", "")
|
|
|
|
|
|
|
|
return when {
|
|
|
|
|
|
|
|
cleanUrl.startsWith(adsUrl) -> true
|
|
|
|
|
|
|
|
cleanUrl.contains("?v=12&data=") -> true
|
|
|
|
|
|
|
|
else -> false
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|