From ab6f97849e90b3fc91cb98f3f156759f0b072a7c Mon Sep 17 00:00:00 2001 From: bapeey <90949336+bapeey@users.noreply.github.com> Date: Fri, 5 Jul 2024 03:58:30 -0500 Subject: [PATCH] SenshiManga: Update api url (#3870) * update api url * Fix search --- src/es/senshimanga/build.gradle | 2 +- .../extension/es/senshimanga/SenshiManga.kt | 15 ++++++--------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/es/senshimanga/build.gradle b/src/es/senshimanga/build.gradle index c1da971cb..b99536eac 100644 --- a/src/es/senshimanga/build.gradle +++ b/src/es/senshimanga/build.gradle @@ -1,7 +1,7 @@ ext { extName = 'Senshi Manga' extClass = '.SenshiManga' - extVersionCode = 1 + extVersionCode = 2 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 3a17e353a..7adedae00 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 @@ -28,13 +28,10 @@ class SenshiManga : HttpSource() { override val supportsLatest = true - private val apiBaseUrl = "https://lat-manga.com" - private val json: Json by injectLazy() override val client: OkHttpClient = network.cloudflareClient.newBuilder() .rateLimitHost(baseUrl.toHttpUrl(), 3) - .rateLimitHost(apiBaseUrl.toHttpUrl(), 3) .build() override fun headersBuilder(): Headers.Builder = super.headersBuilder() @@ -45,17 +42,17 @@ class SenshiManga : HttpSource() { .build() override fun popularMangaRequest(page: Int): Request = - GET("$apiBaseUrl/api/manga-custom?page=$page&limit=$PAGE_LIMIT&order=popular", apiHeaders) + GET("$baseUrl/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("$apiBaseUrl/api/manga-custom?page=$page&limit=$PAGE_LIMIT&order=latest", apiHeaders) + GET("$baseUrl/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 = "$apiBaseUrl/api/manga-custom".toHttpUrl().newBuilder() + val url = "$baseUrl/api/manga-custom".toHttpUrl().newBuilder() url.setQueryParameter("page", page.toString()) url.setQueryParameter("limit", PAGE_LIMIT.toString()) @@ -67,7 +64,7 @@ class SenshiManga : HttpSource() { } } - if (query.isNotBlank()) url.setQueryParameter("q", query) + if (query.isNotBlank()) url.setQueryParameter("title", query) return GET(url.build(), apiHeaders) } @@ -94,7 +91,7 @@ class SenshiManga : HttpSource() { override fun getMangaUrl(manga: SManga): String = "$baseUrl/manga/${manga.url}" override fun mangaDetailsRequest(manga: SManga): Request = - GET("$apiBaseUrl/api/manga-custom/${manga.url}", apiHeaders) + GET("$baseUrl/api/manga-custom/${manga.url}", apiHeaders) override fun mangaDetailsParse(response: Response): SManga { val result = json.decodeFromString>(response.body.string()) @@ -120,7 +117,7 @@ class SenshiManga : HttpSource() { val seriesSlug = chapter.url.substringBefore("/") val chapterSlug = chapter.url.substringAfter("/") - return GET("$apiBaseUrl/api/manga-custom/$seriesSlug/chapter/$chapterSlug/pages", apiHeaders) + return GET("$baseUrl/api/manga-custom/$seriesSlug/chapter/$chapterSlug/pages", apiHeaders) } override fun pageListParse(response: Response): List {