From d0753916027f2523d4de3c2aa58959952a55079f Mon Sep 17 00:00:00 2001 From: Chopper <156493704+choppeh@users.noreply.github.com> Date: Sat, 22 Jun 2024 04:35:27 -0300 Subject: [PATCH] LuraToon: Add login warning (#3689) * Add login warning * Remove interceptor and disable latest tab * Fix lint * Fix --- src/pt/randomscan/build.gradle | 2 +- .../tachiyomi/extension/pt/randomscan/LuraToon.kt | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/pt/randomscan/build.gradle b/src/pt/randomscan/build.gradle index fffe45527..58c426055 100644 --- a/src/pt/randomscan/build.gradle +++ b/src/pt/randomscan/build.gradle @@ -3,7 +3,7 @@ ext { extClass = '.LuraToon' themePkg = 'peachscan' baseUrl = 'https://luratoons.com' - overrideVersionCode = 44 + overrideVersionCode = 45 } apply from: "$rootDir/common.gradle" diff --git a/src/pt/randomscan/src/eu/kanade/tachiyomi/extension/pt/randomscan/LuraToon.kt b/src/pt/randomscan/src/eu/kanade/tachiyomi/extension/pt/randomscan/LuraToon.kt index 686bbea44..5bd49cff2 100644 --- a/src/pt/randomscan/src/eu/kanade/tachiyomi/extension/pt/randomscan/LuraToon.kt +++ b/src/pt/randomscan/src/eu/kanade/tachiyomi/extension/pt/randomscan/LuraToon.kt @@ -10,7 +10,9 @@ import eu.kanade.tachiyomi.lib.randomua.setRandomUserAgent import eu.kanade.tachiyomi.multisrc.peachscan.PeachScan import eu.kanade.tachiyomi.network.interceptor.rateLimit import eu.kanade.tachiyomi.source.ConfigurableSource +import eu.kanade.tachiyomi.source.model.Page import eu.kanade.tachiyomi.source.model.SChapter +import okhttp3.Response import org.jsoup.nodes.Element import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get @@ -28,7 +30,7 @@ class LuraToon : } override val client = super.client.newBuilder() - .rateLimit(1, 2) + .rateLimit(3) .setRandomUserAgent( preferences.getPrefUAType(), preferences.getPrefCustomUA(), @@ -50,4 +52,12 @@ class LuraToon : setUrlWithoutDomain(chapUrl) } } + + override fun pageListParse(response: Response): List { + val pathSegments = response.request.url.pathSegments + if (pathSegments.contains("login") || pathSegments.isEmpty()) { + throw Exception("Faça o login na WebView para acessar o contéudo") + } + return super.pageListParse(response) + } }