From 13fcfc69962386ceb6384c12f4c2df337e7eafbf Mon Sep 17 00:00:00 2001 From: Vetle Ledaal Date: Sat, 27 Jul 2024 16:05:51 +0200 Subject: [PATCH] MANGARAW+: update domain (#4282) Cover images are broken on the site, fixing this by requesting the full res cover instead. --- src/ja/mangarawplus/build.gradle | 4 +-- .../extension/ja/mangarawplus/MangaRawPlus.kt | 31 ++++++++++++++++++- 2 files changed, 32 insertions(+), 3 deletions(-) diff --git a/src/ja/mangarawplus/build.gradle b/src/ja/mangarawplus/build.gradle index bdd8ecf6e..99ee19441 100644 --- a/src/ja/mangarawplus/build.gradle +++ b/src/ja/mangarawplus/build.gradle @@ -2,8 +2,8 @@ ext { extName = 'MANGARAW+' extClass = '.MangaRawPlus' themePkg = 'madara' - baseUrl = 'https://mangarawpedia.com' - overrideVersionCode = 4 + baseUrl = 'https://mangafenxi.net' + overrideVersionCode = 5 isNsfw = true } diff --git a/src/ja/mangarawplus/src/eu/kanade/tachiyomi/extension/ja/mangarawplus/MangaRawPlus.kt b/src/ja/mangarawplus/src/eu/kanade/tachiyomi/extension/ja/mangarawplus/MangaRawPlus.kt index 0523be3fa..18b1a6d14 100644 --- a/src/ja/mangarawplus/src/eu/kanade/tachiyomi/extension/ja/mangarawplus/MangaRawPlus.kt +++ b/src/ja/mangarawplus/src/eu/kanade/tachiyomi/extension/ja/mangarawplus/MangaRawPlus.kt @@ -1,14 +1,43 @@ package eu.kanade.tachiyomi.extension.ja.mangarawplus import eu.kanade.tachiyomi.multisrc.madara.Madara +import eu.kanade.tachiyomi.network.GET +import eu.kanade.tachiyomi.source.model.Page +import eu.kanade.tachiyomi.source.model.SManga +import okhttp3.Request import org.jsoup.nodes.Element -class MangaRawPlus : Madara("MANGARAW+", "https://mangarawpedia.com", "ja") { +class MangaRawPlus : Madara("MANGARAW+", "https://mangafenxi.net", "ja") { + override fun popularMangaSelector() = searchMangaSelector() + + override fun popularMangaRequest(page: Int) = + GET("$baseUrl/?s&post_type=wp-manga&m_orderby=views", headers) + + override fun latestUpdatesSelector() = searchMangaSelector() + + override fun latestUpdatesRequest(page: Int) = + GET("$baseUrl/?s&post_type=wp-manga&m_orderby=latest", headers) + + override fun popularMangaFromElement(element: Element): SManga { + return super.popularMangaFromElement(element).apply { + thumbnail_url = thumbnail_url?.replaceFirst("-193x278", "") + } + } + override fun imageFromElement(element: Element): String? { return when { element.hasAttr("data-src-img") -> element.absUrl("data-src-img") else -> super.imageFromElement(element) } } + + override fun imageRequest(page: Page): Request { + val imgHeaders = headersBuilder().apply { + removeAll("Referer") + }.build() + return GET(page.imageUrl!!, imgHeaders) + } + + override val useLoadMoreRequest = LoadMoreStrategy.Never override val useNewChapterEndpoint = false }