From 96b9dc8b5c0d2e12debee69a4bd41d7f15d7a679 Mon Sep 17 00:00:00 2001 From: Zakhar Timoshenko Date: Fri, 24 Mar 2023 16:05:24 +0300 Subject: [PATCH] [ComicK] Updated API --- .../org/koitharu/kotatsu/parsers/site/ComickFunParser.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/ComickFunParser.kt b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/ComickFunParser.kt index ad3b87b2..aae85a03 100644 --- a/src/main/kotlin/org/koitharu/kotatsu/parsers/site/ComickFunParser.kt +++ b/src/main/kotlin/org/koitharu/kotatsu/parsers/site/ComickFunParser.kt @@ -45,7 +45,7 @@ internal class ComickFunParser(context: MangaLoaderContext) : MangaParser(contex val url = buildString { append("https://api.") append(domain) - append("/search?tachiyomi=true") + append("/v1.0/search?tachiyomi=true") if (!query.isNullOrEmpty()) { if (offset > 0) { return emptyList() @@ -118,7 +118,7 @@ internal class ComickFunParser(context: MangaLoaderContext) : MangaParser(contex ) }, author = jo.getJSONArray("artists").optJSONObject(0)?.getString("name"), - chapters = getChapters(comic.getLong("id")), + chapters = getChapters(comic.getString("hid")), ) } @@ -164,9 +164,9 @@ internal class ComickFunParser(context: MangaLoaderContext) : MangaParser(contex return tags } - private suspend fun getChapters(id: Long): List { + private suspend fun getChapters(hid: String): List { val ja = webClient.httpGet( - url = "https://api.${domain}/comic/$id/chapter?tachiyomi=true&limit=$CHAPTERS_LIMIT", + url = "https://api.${domain}/comic/$hid/chapters?limit=$CHAPTERS_LIMIT", ).parseJson().getJSONArray("chapters") val dateFormat = SimpleDateFormat("yyyy-MM-dd") val counters = HashMap()