From 20b9eff8514431feb7525a316f0f3121cf1e0f92 Mon Sep 17 00:00:00 2001 From: Secozzi <49240133+Secozzi@users.noreply.github.com> Date: Thu, 1 Aug 2024 08:07:00 +0000 Subject: [PATCH] Madokami: use relative chapter urls (#4362) Use relative chapter urls --- src/en/madokami/build.gradle | 2 +- .../eu/kanade/tachiyomi/extension/en/madokami/Madokami.kt | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/en/madokami/build.gradle b/src/en/madokami/build.gradle index 8fd2ab0db..52cdb3886 100644 --- a/src/en/madokami/build.gradle +++ b/src/en/madokami/build.gradle @@ -1,7 +1,7 @@ ext { extName = 'Madokami' extClass = '.Madokami' - extVersionCode = 8 + extVersionCode = 9 } apply from: "$rootDir/common.gradle" diff --git a/src/en/madokami/src/eu/kanade/tachiyomi/extension/en/madokami/Madokami.kt b/src/en/madokami/src/eu/kanade/tachiyomi/extension/en/madokami/Madokami.kt index f3e8052c4..713761916 100644 --- a/src/en/madokami/src/eu/kanade/tachiyomi/extension/en/madokami/Madokami.kt +++ b/src/en/madokami/src/eu/kanade/tachiyomi/extension/en/madokami/Madokami.kt @@ -137,7 +137,8 @@ class Madokami : ConfigurableSource, ParsedHttpSource() { override fun chapterFromElement(element: Element): SChapter { val el = element.parent()!!.parent()!! val chapter = SChapter.create() - chapter.url = el.select("td:nth-child(6) a").attr("href") + chapter.url = "/reader" + el.select("td:nth-child(6) a").attr("href") + .substringAfter("/reader") chapter.name = el.select("td:nth-child(1) a").text() val date = el.select("td:nth-child(3)").text() if (date.endsWith("ago")) { @@ -162,7 +163,10 @@ class Madokami : ConfigurableSource, ParsedHttpSource() { return chapter } - override fun pageListRequest(chapter: SChapter) = authenticate(GET(chapter.url, headers)) + override fun pageListRequest(chapter: SChapter): Request { + require(chapter.url.startsWith("/")) { "Refresh chapter list" } + return authenticate(GET(baseUrl + chapter.url, headers)) + } override fun pageListParse(document: Document): List { val element = document.select("div#reader")