diff --git a/src/pt/goldenmangas/build.gradle b/src/pt/goldenmangas/build.gradle index 13723a103..4f577f631 100644 --- a/src/pt/goldenmangas/build.gradle +++ b/src/pt/goldenmangas/build.gradle @@ -5,7 +5,7 @@ ext { extName = 'Golden Mangás' pkgNameSuffix = 'pt.goldenmangas' extClass = '.GoldenMangas' - extVersionCode = 9 + extVersionCode = 10 libVersion = '1.2' } diff --git a/src/pt/goldenmangas/src/eu/kanade/tachiyomi/extension/pt/goldenmangas/GoldenMangas.kt b/src/pt/goldenmangas/src/eu/kanade/tachiyomi/extension/pt/goldenmangas/GoldenMangas.kt index 113311167..d44a969c4 100644 --- a/src/pt/goldenmangas/src/eu/kanade/tachiyomi/extension/pt/goldenmangas/GoldenMangas.kt +++ b/src/pt/goldenmangas/src/eu/kanade/tachiyomi/extension/pt/goldenmangas/GoldenMangas.kt @@ -35,15 +35,13 @@ class GoldenMangas : ParsedHttpSource() { .connectTimeout(1, TimeUnit.MINUTES) .readTimeout(1, TimeUnit.MINUTES) .writeTimeout(1, TimeUnit.MINUTES) - .addInterceptor(RateLimitInterceptor(1, 1, TimeUnit.SECONDS)) + .addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) .build() override fun headersBuilder(): Headers.Builder = Headers.Builder() .add("Accept", ACCEPT) .add("Accept-Language", ACCEPT_LANGUAGE) - .add("User-Agent", USER_AGENT) - .add("Origin", baseUrl) - .add("Referer", baseUrl) + .add("Referer", REFERER) override fun popularMangaRequest(page: Int): Request = GET(baseUrl, headers) @@ -163,9 +161,9 @@ class GoldenMangas : ParsedHttpSource() { } } - private fun String.toStatus() = when { - contains("Ativo") -> SManga.ONGOING - contains("Completo") -> SManga.COMPLETED + private fun String.toStatus() = when (this) { + "Ativo" -> SManga.ONGOING + "Completo" -> SManga.COMPLETED else -> SManga.UNKNOWN } @@ -178,8 +176,9 @@ class GoldenMangas : ParsedHttpSource() { "image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9" private const val ACCEPT_IMAGE = "image/webp,image/apng,image/*,*/*;q=0.8" 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 REFERER = "https://google.com/" private const val USER_AGENT = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) " + - "AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.128 Safari/537.36" + "AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36" private val FLAG_REGEX = "\\((Pt[-/]br|Scan)\\)".toRegex(RegexOption.IGNORE_CASE)