diff --git a/multisrc/overrides/mangasproject/leitornet/src/LeitorNet.kt b/multisrc/overrides/mangasproject/leitornet/src/LeitorNet.kt index a2272b3c0..1f4851f32 100644 --- a/multisrc/overrides/mangasproject/leitornet/src/LeitorNet.kt +++ b/multisrc/overrides/mangasproject/leitornet/src/LeitorNet.kt @@ -18,9 +18,11 @@ class LeitorNet : MangasProject("Leitor.net", "https://leitor.net", "pt-BR") { override val id: Long = 2225174659569980836 override val client: OkHttpClient = super.client.newBuilder() - .addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) + .addInterceptor(RateLimitInterceptor(1, 3, TimeUnit.SECONDS)) .build() + override val licensedCheck = true + /** * Temporary fix to bypass Cloudflare. */ diff --git a/multisrc/overrides/mangasproject/mangalivre/src/MangaLivre.kt b/multisrc/overrides/mangasproject/mangalivre/src/MangaLivre.kt index 72fd02221..e9d814701 100644 --- a/multisrc/overrides/mangasproject/mangalivre/src/MangaLivre.kt +++ b/multisrc/overrides/mangasproject/mangalivre/src/MangaLivre.kt @@ -17,7 +17,7 @@ class MangaLivre : MangasProject("Mangá Livre", "https://mangalivre.net", "pt-B override val id: Long = 4762777556012432014 override val client: OkHttpClient = super.client.newBuilder() - .addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) + .addInterceptor(RateLimitInterceptor(1, 3, TimeUnit.SECONDS)) .build() override fun popularMangaRequest(page: Int): Request { diff --git a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/mangasproject/MangasProject.kt b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/mangasproject/MangasProject.kt index 8a44c2361..f3fab17e5 100644 --- a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/mangasproject/MangasProject.kt +++ b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/mangasproject/MangasProject.kt @@ -56,6 +56,8 @@ abstract class MangasProject( private val json: Json by injectLazy() + protected open val licensedCheck: Boolean = false + override fun popularMangaRequest(page: Int): Request { return GET("$baseUrl/home/most_read?page=$page&type=", sourceHeaders) } @@ -136,7 +138,7 @@ abstract class MangasProject( val isCompleted = seriesData.select("span.series-author i.complete-series").first() != null // Check if the manga was removed by the publisher. - val seriesBlocked = document.select("div.series-blocked-img").first() + val seriesBlocked = document.select("div.series-blocked-img:has(img[src$=blocked.svg])").first() val seriesAuthors = document.select("div#series-data span.series-author").text() .substringAfter("Completo") @@ -166,7 +168,7 @@ abstract class MangasProject( } private fun parseStatus(seriesBlocked: Element?, isCompleted: Boolean) = when { - seriesBlocked != null -> SManga.LICENSED + seriesBlocked != null && licensedCheck -> SManga.LICENSED isCompleted -> SManga.COMPLETED else -> SManga.ONGOING } @@ -188,9 +190,9 @@ abstract class MangasProject( override fun chapterListParse(response: Response): List { val document = response.asJsoup() - val licensedMessage = document.select("div.series-blocked-img").firstOrNull() + val licensedMessage = document.select("div.series-blocked-img:has(img[src$=blocked.svg])").firstOrNull() - if (licensedMessage != null) { + if (licensedMessage != null && licensedCheck) { // If the manga is licensed and has been removed from the source, // the extension will not fetch the chapters, even if they are returned // by the API. This is just to mimic the website behavior. diff --git a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/mangasproject/MangasProjectGenerator.kt b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/mangasproject/MangasProjectGenerator.kt index 442839c22..366ebf69d 100644 --- a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/mangasproject/MangasProjectGenerator.kt +++ b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/mangasproject/MangasProjectGenerator.kt @@ -9,7 +9,7 @@ class MangasProjectGenerator : ThemeSourceGenerator { override val themeClass = "MangasProject" - override val baseVersionCode: Int = 9 + override val baseVersionCode: Int = 10 override val sources = listOf( SingleLang("Leitor.net", "https://leitor.net", "pt-BR", className = "LeitorNet", isNsfw = true),