From d6953b899e69a05305ae96f061211fc037dcc5b3 Mon Sep 17 00:00:00 2001 From: bapeey <90949336+bapeey@users.noreply.github.com> Date: Sun, 31 Mar 2024 01:26:31 -0500 Subject: [PATCH] IkigaiMangas: Fix webview (#2183) * Fix webview * wtf, why i made this --- src/es/ikigaimangas/build.gradle | 2 +- .../extension/es/ikigaimangas/IkigaiMangas.kt | 18 +++++++++++------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/es/ikigaimangas/build.gradle b/src/es/ikigaimangas/build.gradle index dc3c9cb4b..9416e8984 100644 --- a/src/es/ikigaimangas/build.gradle +++ b/src/es/ikigaimangas/build.gradle @@ -1,7 +1,7 @@ ext { extName = 'Ikigai Mangas' extClass = '.IkigaiMangas' - extVersionCode = 3 + extVersionCode = 4 isNsfw = true } diff --git a/src/es/ikigaimangas/src/eu/kanade/tachiyomi/extension/es/ikigaimangas/IkigaiMangas.kt b/src/es/ikigaimangas/src/eu/kanade/tachiyomi/extension/es/ikigaimangas/IkigaiMangas.kt index c630d512b..67439fa42 100644 --- a/src/es/ikigaimangas/src/eu/kanade/tachiyomi/extension/es/ikigaimangas/IkigaiMangas.kt +++ b/src/es/ikigaimangas/src/eu/kanade/tachiyomi/extension/es/ikigaimangas/IkigaiMangas.kt @@ -102,18 +102,22 @@ class IkigaiMangas : HttpSource() { return MangasPage(mangaList, result.hasNextPage()) } - override fun mangaDetailsParse(response: Response): SManga { - val slug = response.request.url - .toString() + override fun getMangaUrl(manga: SManga) = baseUrl + manga.url.substringBefore("#") + + override fun mangaDetailsRequest(manga: SManga): Request { + val slug = manga.url .substringAfter("/series/comic-") .substringBefore("#") - val apiUrl = "$apiBaseUrl/api/swf/series/$slug".toHttpUrl() - val newResponse = client.newCall(GET(url = apiUrl, headers = headers)).execute() - val result = json.decodeFromString(newResponse.body.string()) + + return GET("$apiBaseUrl/api/swf/series/$slug", headers) + } + + override fun mangaDetailsParse(response: Response): SManga { + val result = json.decodeFromString(response.body.string()) return result.series.toSMangaDetails() } - override fun getChapterUrl(chapter: SChapter) = baseUrl + chapter.url + override fun getChapterUrl(chapter: SChapter) = baseUrl + chapter.url.substringBefore("#") override fun chapterListRequest(manga: SManga): Request { val slug = manga.url.substringAfter("/series/comic-").substringBefore("#")