diff --git a/multisrc/overrides/mangathemesia/cosmicscansid/src/CosmicScansID.kt b/multisrc/overrides/mangathemesia/cosmicscansid/src/CosmicScansID.kt index 26a5a578c..ffc1a75c3 100644 --- a/multisrc/overrides/mangathemesia/cosmicscansid/src/CosmicScansID.kt +++ b/multisrc/overrides/mangathemesia/cosmicscansid/src/CosmicScansID.kt @@ -1,8 +1,57 @@ package eu.kanade.tachiyomi.extension.id.cosmicscansid import eu.kanade.tachiyomi.multisrc.mangathemesia.MangaThemesia +import eu.kanade.tachiyomi.network.GET +import eu.kanade.tachiyomi.network.interceptor.rateLimit +import eu.kanade.tachiyomi.source.model.Filter +import eu.kanade.tachiyomi.source.model.FilterList +import okhttp3.HttpUrl.Companion.toHttpUrl +import okhttp3.OkHttpClient +import okhttp3.Request +import java.util.concurrent.TimeUnit -class CosmicScansID : MangaThemesia("CosmicScans.id", "https://cosmicscans.id", "id") { +class CosmicScansID : MangaThemesia("CosmicScans.id", "https://cosmicscans.id", "id", "/semua-komik") { + + override val client: OkHttpClient = super.client.newBuilder() + .rateLimit(20, 4, TimeUnit.SECONDS) + .build() override val hasProjectPage = true + override val projectPageString = "/semua-komik" + + // search + override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request { + val url = baseUrl.toHttpUrl().newBuilder() + .addPathSegments("page/$page/") + .addQueryParameter("s", query) + + filters.forEach { filter -> + when (filter) { + // if site has project page, default value "hasProjectPage" = false + is ProjectFilter -> { + if (filter.selectedValue() == "project-filter-on") { + url.setPathSegment(0, projectPageString.substring(1)) + } + } + else -> { /* Do Nothing */ } + } + } + return GET(url.toString()) + } + + override fun getFilterList(): FilterList { + val filters = mutableListOf>( + Filter.Separator(), + Filter.Header("$name Project List page"), + ProjectFilter(), + OrderByFilter(), + ) + return FilterList(filters) + } + + // manga details + override val seriesDescriptionSelector = ".entry-content[itemprop=description] :not(a,p:has(a))" + + // pages + override val pageSelector = "div#readerarea img:not(noscript img)" } 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 d2fbaee34..026aa1dd7 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 @@ -27,7 +27,7 @@ class MangaThemesiaGenerator : ThemeSourceGenerator { SingleLang("Boosei", "https://boosei.net", "id", overrideVersionCode = 2), SingleLang("Cartel de Manhwas", "https://carteldemanhwas.com", "es", overrideVersionCode = 5), SingleLang("Cosmic Scans", "https://cosmicscans.com", "en", overrideVersionCode = 1), - SingleLang("CosmicScans.id", "https://cosmicscans.id", "id", overrideVersionCode = 1, className = "CosmicScansID"), + SingleLang("CosmicScans.id", "https://cosmicscans.id", "id", overrideVersionCode = 2, className = "CosmicScansID"), SingleLang("Diskus Scan", "https://diskusscan.com", "pt-BR", overrideVersionCode = 7), SingleLang("Dojing.net", "https://dojing.net", "id", isNsfw = true, className = "DojingNet"), SingleLang("DuniaKomik.id", "https://duniakomik.org", "id", className = "DuniaKomikId", overrideVersionCode = 2),