Enable MangaPlus chapters in mangadex delegation
This commit is contained in:
parent
1f9b69fc07
commit
333f55a44b
@ -4,9 +4,6 @@ import eu.kanade.tachiyomi.network.parseAs
|
||||
import eu.kanade.tachiyomi.source.model.Page
|
||||
import exh.md.handlers.serializers.ChapterResponse
|
||||
import exh.md.utils.MdUtil
|
||||
import kotlinx.serialization.json.JsonObject
|
||||
import kotlinx.serialization.json.jsonObject
|
||||
import kotlinx.serialization.json.jsonPrimitive
|
||||
import okhttp3.Response
|
||||
|
||||
class ApiChapterParser {
|
||||
@ -33,8 +30,8 @@ class ApiChapterParser {
|
||||
}
|
||||
|
||||
fun externalParse(response: Response): String {
|
||||
val json = response.parseAs<JsonObject>()
|
||||
val external = json["data"]!!.jsonObject["pages"]!!.jsonPrimitive.content
|
||||
val chapterResponse = response.parseAs<ChapterResponse>()
|
||||
val external = chapterResponse.data.attributes.data.first()
|
||||
return external.substringAfterLast("/")
|
||||
}
|
||||
}
|
||||
|
@ -245,7 +245,7 @@ class ApiMangaParser(val client: OkHttpClient, private val lang: String) {
|
||||
.map {
|
||||
mapChapter(it, groupMap)
|
||||
}.filter {
|
||||
it.dateUpload <= now && "MangaPlus" != it.scanlator
|
||||
it.dateUpload <= now
|
||||
}.toList()
|
||||
}
|
||||
|
||||
|
@ -82,11 +82,11 @@ class MangaPlusHandler(currentClient: OkHttpClient) {
|
||||
|
||||
val content = image
|
||||
.map { it.toInt() }
|
||||
.toMutableList()
|
||||
.toIntArray()
|
||||
|
||||
val blockSizeInBytes = keyStream.size
|
||||
|
||||
for ((i, value) in content.iterator().withIndex()) {
|
||||
content.forEachIndexed { i, value ->
|
||||
content[i] = value xor keyStream[i % blockSizeInBytes]
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user