diff --git a/multisrc/overrides/mangathemesia/mangaswat/src/MangaSwat.kt b/multisrc/overrides/mangathemesia/mangaswat/src/MangaSwat.kt index 3b65510b8..31d8bec74 100644 --- a/multisrc/overrides/mangathemesia/mangaswat/src/MangaSwat.kt +++ b/multisrc/overrides/mangathemesia/mangaswat/src/MangaSwat.kt @@ -7,12 +7,14 @@ import androidx.preference.PreferenceScreen import eu.kanade.tachiyomi.extension.BuildConfig import eu.kanade.tachiyomi.multisrc.mangathemesia.MangaThemesia import eu.kanade.tachiyomi.network.interceptor.rateLimit +import eu.kanade.tachiyomi.source.model.FilterList import eu.kanade.tachiyomi.source.model.Page import eu.kanade.tachiyomi.source.model.SChapter import kotlinx.serialization.Serializable import kotlinx.serialization.decodeFromString import okhttp3.Headers import okhttp3.OkHttpClient +import okhttp3.Request import org.jsoup.nodes.Document import org.jsoup.nodes.Element import uy.kohesive.injekt.Injekt @@ -41,6 +43,23 @@ class MangaSwat : MangaThemesia( override fun headersBuilder(): Headers.Builder = super.headersBuilder() .add("Referer", "$baseUrl/") + override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request { + val request = super.searchMangaRequest(page, query, filters) + if (query.isBlank()) return request + + val url = request.url.newBuilder() + .removePathSegment(0) + .removeAllQueryParameters("title") + .addQueryParameter("s", query) + .build() + + return request.newBuilder() + .url(url) + .build() + } + + override fun searchMangaNextPageSelector() = "a[rel=next]" + override val seriesArtistSelector = "span:contains(الناشر) i" override val seriesAuthorSelector = "span:contains(المؤلف) i" override val seriesGenreSelector = "span:contains(التصنيف) a, .mgen a" diff --git a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/mangathemesia/MangaThemesiaGenerator.kt b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/mangathemesia/MangaThemesiaGenerator.kt index b78645b2a..cecb47aa4 100644 --- a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/mangathemesia/MangaThemesiaGenerator.kt +++ b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/mangathemesia/MangaThemesiaGenerator.kt @@ -72,7 +72,7 @@ class MangaThemesiaGenerator : ThemeSourceGenerator { SingleLang("MangaWT", "https://mangawt.com", "tr", overrideVersionCode = 5), SingleLang("Mangayaro", "https://mangayaro.net", "id"), SingleLang("Manhwa Lover", "https://manhwalover.com", "en", isNsfw = true, overrideVersionCode = 1), - SingleLang("MangaSwat", "https://swatop.club", "ar", overrideVersionCode = 10), + SingleLang("MangaSwat", "https://swatop.club", "ar", overrideVersionCode = 11), SingleLang("MangKomik", "https://mangkomik.net", "id", overrideVersionCode = 1), SingleLang("Mangás Chan", "https://mangaschan.com", "pt-BR", className = "MangasChan"), SingleLang("Manhwa Freak", "https://manhwafreak.com", "en", overrideVersionCode = 1),