From f7a92a1573d63f61fdfb36b7c9ddb619bba8277d Mon Sep 17 00:00:00 2001 From: AwkwardPeak7 <48650614+AwkwardPeak7@users.noreply.github.com> Date: Tue, 13 Aug 2024 06:13:01 +0500 Subject: [PATCH] AdultWebtoons: fix chapter list & search (#4580) --- src/en/adultwebtoon/build.gradle | 2 +- .../extension/en/adultwebtoon/AdultWebtoon.kt | 29 +++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/src/en/adultwebtoon/build.gradle b/src/en/adultwebtoon/build.gradle index 96e41ce9d..eabdc0ae4 100644 --- a/src/en/adultwebtoon/build.gradle +++ b/src/en/adultwebtoon/build.gradle @@ -3,7 +3,7 @@ ext { extClass = '.AdultWebtoon' themePkg = 'madara' baseUrl = 'https://adultwebtoon.com' - overrideVersionCode = 2 + overrideVersionCode = 3 isNsfw = true } diff --git a/src/en/adultwebtoon/src/eu/kanade/tachiyomi/extension/en/adultwebtoon/AdultWebtoon.kt b/src/en/adultwebtoon/src/eu/kanade/tachiyomi/extension/en/adultwebtoon/AdultWebtoon.kt index 73dc3ec62..5a61e610c 100644 --- a/src/en/adultwebtoon/src/eu/kanade/tachiyomi/extension/en/adultwebtoon/AdultWebtoon.kt +++ b/src/en/adultwebtoon/src/eu/kanade/tachiyomi/extension/en/adultwebtoon/AdultWebtoon.kt @@ -1,7 +1,36 @@ package eu.kanade.tachiyomi.extension.en.adultwebtoon import eu.kanade.tachiyomi.multisrc.madara.Madara +import eu.kanade.tachiyomi.network.POST +import eu.kanade.tachiyomi.source.model.SManga +import okhttp3.FormBody +import okhttp3.Request +import org.jsoup.nodes.Element class AdultWebtoon : Madara("Adult Webtoon", "https://adultwebtoon.com", "en") { override val mangaSubString = "adult-webtoon" + override val useNewChapterEndpoint = false + override val sendViewCount = false + override val fetchGenres = false + override val useLoadMoreRequest = LoadMoreStrategy.Never + + override fun popularMangaNextPageSelector() = "a.next" + override fun searchMangaSelector() = "li.movie-item > a" + override fun searchMangaNextPageSelector() = "a.next" + + override fun searchMangaFromElement(element: Element): SManga { + return SManga.create().apply { + setUrlWithoutDomain(element.absUrl("href")) + title = element.attr("title") + } + } + + override fun oldXhrChaptersRequest(mangaId: String): Request { + val form = FormBody.Builder() + .add("action", "ajax_chap") + .add("post_id", mangaId) + .build() + + return POST("$baseUrl/wp-admin/admin-ajax.php", xhrHeaders, form) + } }