From 7fce782a92d4b2784eb0527750b6600b800a592a Mon Sep 17 00:00:00 2001 From: Lefan <56052054+LefanHu@users.noreply.github.com> Date: Mon, 14 Oct 2024 07:46:24 -0400 Subject: [PATCH] ArazNovel: fix chapterlist parse (#5509) * fix selectors * default madara works * update baseurl --- src/tr/araznovel/build.gradle | 4 +-- .../extension/tr/araznovel/ArazNovel.kt | 31 ++++--------------- 2 files changed, 8 insertions(+), 27 deletions(-) diff --git a/src/tr/araznovel/build.gradle b/src/tr/araznovel/build.gradle index cae1e6899..09a14e2be 100644 --- a/src/tr/araznovel/build.gradle +++ b/src/tr/araznovel/build.gradle @@ -2,8 +2,8 @@ ext { extName = 'ArazNovel' extClass = '.ArazNovel' themePkg = 'madara' - baseUrl = 'https://www.araznovel.com' - overrideVersionCode = 3 + baseUrl = 'https://araznovel.com' + overrideVersionCode = 4 } apply from: "$rootDir/common.gradle" diff --git a/src/tr/araznovel/src/eu/kanade/tachiyomi/extension/tr/araznovel/ArazNovel.kt b/src/tr/araznovel/src/eu/kanade/tachiyomi/extension/tr/araznovel/ArazNovel.kt index a26379ba8..61ac82b71 100644 --- a/src/tr/araznovel/src/eu/kanade/tachiyomi/extension/tr/araznovel/ArazNovel.kt +++ b/src/tr/araznovel/src/eu/kanade/tachiyomi/extension/tr/araznovel/ArazNovel.kt @@ -1,31 +1,12 @@ package eu.kanade.tachiyomi.extension.tr.araznovel import eu.kanade.tachiyomi.multisrc.madara.Madara -import eu.kanade.tachiyomi.source.model.SChapter -import eu.kanade.tachiyomi.util.asJsoup -import okhttp3.Response import java.text.SimpleDateFormat import java.util.Locale -class ArazNovel : Madara("ArazNovel", "https://www.araznovel.com", "tr", SimpleDateFormat("dd/MM/yyyy", Locale.getDefault())) { - - override fun chapterListParse(response: Response): List { - val document = response.asJsoup() - val mangaId = document.select("div#manga-chapters-holder").attr("data-id") - - val xhrRequest = oldXhrChaptersRequest(mangaId) - val xhrResponse = client.newCall(xhrRequest).execute() - - return xhrResponse.asJsoup().let { xhrDocument -> - xhrDocument.select("li.parent").let { elements -> - if (!elements.isNullOrEmpty()) { - elements.reversed() - .map { volumeElement -> volumeElement.select(chapterListSelector()).map { chapterFromElement(it) } } - .flatten() - } else { - xhrDocument.select(chapterListSelector()).map { chapterFromElement(it) } - } - } - } - } -} +class ArazNovel : Madara( + "ArazNovel", + "https://araznovel.com", + "tr", + SimpleDateFormat("dd/MM/yyyy", Locale.getDefault()), +)