LuraToon: Add login warning (#3689)

* Add login warning

* Remove interceptor and disable latest tab

* Fix lint

* Fix
This commit is contained in:
Chopper 2024-06-22 04:35:27 -03:00 committed by Draff
parent d6512ee2f5
commit d075391602
No known key found for this signature in database
GPG Key ID: E8A89F3211677653
2 changed files with 12 additions and 2 deletions

View File

@ -3,7 +3,7 @@ ext {
extClass = '.LuraToon'
themePkg = 'peachscan'
baseUrl = 'https://luratoons.com'
overrideVersionCode = 44
overrideVersionCode = 45
}
apply from: "$rootDir/common.gradle"

View File

@ -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<Page> {
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)
}
}