diff --git a/src/pt/supermangas/build.gradle b/src/pt/supermangas/build.gradle index 7ae0d1cdf..c91d66f49 100644 --- a/src/pt/supermangas/build.gradle +++ b/src/pt/supermangas/build.gradle @@ -5,7 +5,7 @@ ext { extName = 'Super Mangás' pkgNameSuffix = 'pt.supermangas' extClass = '.SuperMangasFactory' - extVersionCode = 4 + extVersionCode = 5 libVersion = '1.2' containsNsfw = true } diff --git a/src/pt/supermangas/src/eu/kanade/tachiyomi/extension/pt/supermangas/SuperMangasGeneric.kt b/src/pt/supermangas/src/eu/kanade/tachiyomi/extension/pt/supermangas/SuperMangasGeneric.kt index 55f0c0f7c..caf2d9742 100644 --- a/src/pt/supermangas/src/eu/kanade/tachiyomi/extension/pt/supermangas/SuperMangasGeneric.kt +++ b/src/pt/supermangas/src/eu/kanade/tachiyomi/extension/pt/supermangas/SuperMangasGeneric.kt @@ -352,7 +352,8 @@ abstract class SuperMangasGeneric( else -> SManga.UNKNOWN } - protected fun Response.asJsonObject(): JsonObject = JSON_PARSER.parse(body()!!.string()).obj + protected fun Response.asJsonObject(): JsonObject = + JSON_PARSER.parse(body()!!.string().substringAfter("")).obj private fun Map.toUrlQueryParams(): String = map { (k, v) -> "$k=$v" }.joinToString("&") @@ -364,10 +365,12 @@ abstract class SuperMangasGeneric( } companion object { - private const val ACCEPT_COMMON = "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9" + private const val ACCEPT_COMMON = "text/html,application/xhtml+xml,application/xml;q=0.9," + + "image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9" private const val ACCEPT_JSON = "application/json, text/javascript, */*; q=0.01" private const val ACCEPT_LANGUAGE = "pt-BR,pt;q=0.9,en-US;q=0.8,en;q=0.7,es;q=0.6,gl;q=0.5" - private const val USER_AGENT = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36" + private const val USER_AGENT = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) " + + "AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.66 Safari/537.36" private val JSON_PARSER by lazy { JsonParser() } diff --git a/src/pt/supermangas/src/eu/kanade/tachiyomi/extension/pt/supermangas/source/SuperMangas.kt b/src/pt/supermangas/src/eu/kanade/tachiyomi/extension/pt/supermangas/source/SuperMangas.kt index 03fc33e3a..743a22cfb 100644 --- a/src/pt/supermangas/src/eu/kanade/tachiyomi/extension/pt/supermangas/source/SuperMangas.kt +++ b/src/pt/supermangas/src/eu/kanade/tachiyomi/extension/pt/supermangas/source/SuperMangas.kt @@ -1,9 +1,12 @@ package eu.kanade.tachiyomi.extension.pt.supermangas.source import eu.kanade.tachiyomi.extension.pt.supermangas.SuperMangasGeneric +import eu.kanade.tachiyomi.network.GET import eu.kanade.tachiyomi.source.model.Filter import eu.kanade.tachiyomi.source.model.FilterList import okhttp3.FormBody +import okhttp3.HttpUrl +import okhttp3.Request class SuperMangas : SuperMangasGeneric( "Super Mangás", @@ -17,6 +20,15 @@ class SuperMangas : SuperMangasGeneric( Triple("10", "", "Manhua") ) + override fun searchMangaWithQueryRequest(query: String): Request { + val searchUrl = HttpUrl.parse("$baseUrl/busca")!!.newBuilder() + .addEncodedQueryParameter("parametro", query) + .addEncodedQueryParameter("search_type", "serie") + .toString() + + return GET(searchUrl, headers) + } + override fun chapterListPaginatedBody(idCategory: Int, page: Int, totalPage: Int): FormBody.Builder = super.chapterListPaginatedBody(idCategory, page, totalPage) .add("order_audio", "pt-br")