LuraToon: Add login warning (#3689)
* Add login warning * Remove interceptor and disable latest tab * Fix lint * Fix
This commit is contained in:
parent
d6512ee2f5
commit
d075391602
|
@ -3,7 +3,7 @@ ext {
|
|||
extClass = '.LuraToon'
|
||||
themePkg = 'peachscan'
|
||||
baseUrl = 'https://luratoons.com'
|
||||
overrideVersionCode = 44
|
||||
overrideVersionCode = 45
|
||||
}
|
||||
|
||||
apply from: "$rootDir/common.gradle"
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue