SlimeRead: Use cloudflareClient (#3235)

* j2k fix

* here too
This commit is contained in:
bapeey 2024-05-26 02:56:40 -05:00 committed by Draff
parent 5966f9699b
commit f7b2ff60ac
2 changed files with 3 additions and 3 deletions

View File

@ -1,7 +1,7 @@
ext {
extName = 'SlimeRead'
extClass = '.SlimeRead'
extVersionCode = 9
extVersionCode = 10
isNsfw = true
}

View File

@ -40,7 +40,7 @@ class SlimeRead : HttpSource() {
override val supportsLatest = true
override val client by lazy {
network.client.newBuilder()
network.cloudflareClient.newBuilder()
.rateLimitHost(baseUrl.toHttpUrl(), 2)
.rateLimitHost(apiUrl.toHttpUrl(), 1)
.build()
@ -51,7 +51,7 @@ class SlimeRead : HttpSource() {
private val json: Json by injectLazy()
private fun getApiUrlFromPage(): String {
val initClient = network.client
val initClient = network.cloudflareClient
val document = initClient.newCall(GET(baseUrl, headers)).execute().asJsoup()
val scriptUrl = document.selectFirst("script[src*=pages/_app]")?.attr("abs:src")
?: throw Exception("Could not find script URL")