From 3c13e2f1ec1de2fcf5c02e16e39f27952f822601 Mon Sep 17 00:00:00 2001 From: bapeey <90949336+bapeey@users.noreply.github.com> Date: Mon, 15 Jul 2024 00:19:15 -0500 Subject: [PATCH] SenshiManga: Update api url (#4002) * Update apiUrl * Ratelimit --- src/es/senshimanga/build.gradle | 2 +- .../extension/es/senshimanga/SenshiManga.kt | 13 ++++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/es/senshimanga/build.gradle b/src/es/senshimanga/build.gradle index b99536eac..23c9b3885 100644 --- a/src/es/senshimanga/build.gradle +++ b/src/es/senshimanga/build.gradle @@ -1,7 +1,7 @@ ext { extName = 'Senshi Manga' extClass = '.SenshiManga' - extVersionCode = 2 + extVersionCode = 3 isNsfw = false } diff --git a/src/es/senshimanga/src/eu/kanade/tachiyomi/extension/es/senshimanga/SenshiManga.kt b/src/es/senshimanga/src/eu/kanade/tachiyomi/extension/es/senshimanga/SenshiManga.kt index 7adedae00..b320adae7 100644 --- a/src/es/senshimanga/src/eu/kanade/tachiyomi/extension/es/senshimanga/SenshiManga.kt +++ b/src/es/senshimanga/src/eu/kanade/tachiyomi/extension/es/senshimanga/SenshiManga.kt @@ -24,6 +24,8 @@ class SenshiManga : HttpSource() { override val baseUrl = "https://senshimanga.com" + private val apiUrl = "https://api.senshimanga.com" + override val lang = "es" override val supportsLatest = true @@ -32,6 +34,7 @@ class SenshiManga : HttpSource() { override val client: OkHttpClient = network.cloudflareClient.newBuilder() .rateLimitHost(baseUrl.toHttpUrl(), 3) + .rateLimitHost(apiUrl.toHttpUrl(), 3) .build() override fun headersBuilder(): Headers.Builder = super.headersBuilder() @@ -42,17 +45,17 @@ class SenshiManga : HttpSource() { .build() override fun popularMangaRequest(page: Int): Request = - GET("$baseUrl/api/manga-custom?page=$page&limit=$PAGE_LIMIT&order=popular", apiHeaders) + GET("$apiUrl/api/manga-custom?page=$page&limit=$PAGE_LIMIT&order=popular", apiHeaders) override fun popularMangaParse(response: Response): MangasPage = searchMangaParse(response) override fun latestUpdatesRequest(page: Int): Request = - GET("$baseUrl/api/manga-custom?page=$page&limit=$PAGE_LIMIT&order=latest", apiHeaders) + GET("$apiUrl/api/manga-custom?page=$page&limit=$PAGE_LIMIT&order=latest", apiHeaders) override fun latestUpdatesParse(response: Response): MangasPage = searchMangaParse(response) override fun searchMangaRequest(page: Int, query: String, filters: FilterList): Request { - val url = "$baseUrl/api/manga-custom".toHttpUrl().newBuilder() + val url = "$apiUrl/api/manga-custom".toHttpUrl().newBuilder() url.setQueryParameter("page", page.toString()) url.setQueryParameter("limit", PAGE_LIMIT.toString()) @@ -91,7 +94,7 @@ class SenshiManga : HttpSource() { override fun getMangaUrl(manga: SManga): String = "$baseUrl/manga/${manga.url}" override fun mangaDetailsRequest(manga: SManga): Request = - GET("$baseUrl/api/manga-custom/${manga.url}", apiHeaders) + GET("$apiUrl/api/manga-custom/${manga.url}", apiHeaders) override fun mangaDetailsParse(response: Response): SManga { val result = json.decodeFromString>(response.body.string()) @@ -117,7 +120,7 @@ class SenshiManga : HttpSource() { val seriesSlug = chapter.url.substringBefore("/") val chapterSlug = chapter.url.substringAfter("/") - return GET("$baseUrl/api/manga-custom/$seriesSlug/chapter/$chapterSlug/pages", apiHeaders) + return GET("$apiUrl/api/manga-custom/$seriesSlug/chapter/$chapterSlug/pages", apiHeaders) } override fun pageListParse(response: Response): List {