Fix MangaPlus chapters for MangaDex
This commit is contained in:
parent
a17c4c151f
commit
34f8407983
@ -151,8 +151,8 @@ class MangaDex(delegate: HttpSource, val context: Context) :
|
||||
}
|
||||
|
||||
private fun mangaPlusPageListRequest(chapter: SChapter): Request {
|
||||
val chpUrl = chapter.url.substringBefore(MdUtil.apiChapterSuffix)
|
||||
return GET(MdUtil.baseUrl + chpUrl + MdUtil.apiChapterSuffix, headers, CacheControl.FORCE_NETWORK)
|
||||
val urlChapterId = MdUtil.getChapterId(chapter.url)
|
||||
return GET(MdUtil.apiUrl + MdUtil.newApiChapter + urlChapterId + MdUtil.apiChapterSuffix, headers, CacheControl.FORCE_NETWORK)
|
||||
}
|
||||
|
||||
override fun fetchImage(page: Page): Observable<Response> {
|
||||
|
@ -4,8 +4,6 @@ import eu.kanade.tachiyomi.network.parseAs
|
||||
import eu.kanade.tachiyomi.source.model.Page
|
||||
import exh.md.handlers.serializers.ApiChapterSerializer
|
||||
import exh.md.utils.MdUtil
|
||||
import kotlinx.serialization.decodeFromString
|
||||
import kotlinx.serialization.json.Json
|
||||
import kotlinx.serialization.json.JsonObject
|
||||
import kotlinx.serialization.json.jsonObject
|
||||
import kotlinx.serialization.json.jsonPrimitive
|
||||
@ -27,8 +25,7 @@ class ApiChapterParser {
|
||||
}
|
||||
|
||||
fun externalParse(response: Response): String {
|
||||
val jsonData = response.body!!.string()
|
||||
val json = Json.decodeFromString<JsonObject>(jsonData)
|
||||
val json = response.parseAs<JsonObject>()
|
||||
val external = json["data"]!!.jsonObject["pages"]!!.jsonPrimitive.content
|
||||
return external.substringAfterLast("/")
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user