From d3a34b569334dec4df2879ce29bb5b1373bcddc3 Mon Sep 17 00:00:00 2001 From: bapeey <90949336+bapeey@users.noreply.github.com> Date: Sun, 21 Apr 2024 02:12:06 -0500 Subject: [PATCH] IkigaiMangas: Fix http 404 when reading a chapter (#2511) * fix pages * remove dto --- src/es/ikigaimangas/build.gradle | 2 +- .../extension/es/ikigaimangas/IkigaiMangas.kt | 12 ++++++------ .../extension/es/ikigaimangas/IkigaiMangasDto.kt | 10 ---------- 3 files changed, 7 insertions(+), 17 deletions(-) diff --git a/src/es/ikigaimangas/build.gradle b/src/es/ikigaimangas/build.gradle index 07bed3bcc..198192c64 100644 --- a/src/es/ikigaimangas/build.gradle +++ b/src/es/ikigaimangas/build.gradle @@ -1,7 +1,7 @@ ext { extName = 'Ikigai Mangas' extClass = '.IkigaiMangas' - extVersionCode = 5 + extVersionCode = 6 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 922db7129..b87c73dd9 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 @@ -9,6 +9,7 @@ import eu.kanade.tachiyomi.source.model.Page import eu.kanade.tachiyomi.source.model.SChapter import eu.kanade.tachiyomi.source.model.SManga import eu.kanade.tachiyomi.source.online.HttpSource +import eu.kanade.tachiyomi.util.asJsoup import kotlinx.serialization.decodeFromString import kotlinx.serialization.json.Json import okhttp3.HttpUrl.Companion.toHttpUrl @@ -141,14 +142,13 @@ class IkigaiMangas : HttpSource() { return mangas } - override fun pageListRequest(chapter: SChapter): Request { - val id = chapter.url.substringAfter("/capitulo/") - return GET("$apiBaseUrl/api/swf/chapters/$id", headers) - } + override fun pageListRequest(chapter: SChapter): Request = + GET(baseUrl + chapter.url.substringBefore("#"), headers) override fun pageListParse(response: Response): List { - return json.decodeFromString(response.body.string()).chapter.pages.mapIndexed { i, img -> - Page(i, "", img) + val document = response.asJsoup() + return document.select("section > div.img > img").mapIndexed { i, element -> + Page(i, imageUrl = element.attr("abs:src")) } } diff --git a/src/es/ikigaimangas/src/eu/kanade/tachiyomi/extension/es/ikigaimangas/IkigaiMangasDto.kt b/src/es/ikigaimangas/src/eu/kanade/tachiyomi/extension/es/ikigaimangas/IkigaiMangasDto.kt index 5451490f0..48112078a 100644 --- a/src/es/ikigaimangas/src/eu/kanade/tachiyomi/extension/es/ikigaimangas/IkigaiMangasDto.kt +++ b/src/es/ikigaimangas/src/eu/kanade/tachiyomi/extension/es/ikigaimangas/IkigaiMangasDto.kt @@ -109,16 +109,6 @@ class ChapterMetaDto( fun hasNextPage() = currentPage < lastPage } -@Serializable -class PayloadPagesDto( - val chapter: PageDto, -) - -@Serializable -class PageDto( - val pages: List, -) - @Serializable class SeriesStatusDto( val id: Long,