Handle Brotli-compressed responses
This commit is contained in:
parent
cb8ea5eab0
commit
7cf2ce2994
3 changed files with 5 additions and 1 deletions
|
@ -25,6 +25,7 @@ dependencies {
|
||||||
|
|
||||||
api(libs.okhttp.core)
|
api(libs.okhttp.core)
|
||||||
api(libs.okhttp.logging)
|
api(libs.okhttp.logging)
|
||||||
|
api(libs.okhttp.brotli)
|
||||||
api(libs.okhttp.dnsoverhttps)
|
api(libs.okhttp.dnsoverhttps)
|
||||||
api(libs.okio)
|
api(libs.okio)
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,7 @@ import eu.kanade.tachiyomi.network.interceptor.UncaughtExceptionInterceptor
|
||||||
import eu.kanade.tachiyomi.network.interceptor.UserAgentInterceptor
|
import eu.kanade.tachiyomi.network.interceptor.UserAgentInterceptor
|
||||||
import okhttp3.Cache
|
import okhttp3.Cache
|
||||||
import okhttp3.OkHttpClient
|
import okhttp3.OkHttpClient
|
||||||
|
import okhttp3.brotli.BrotliInterceptor
|
||||||
import okhttp3.logging.HttpLoggingInterceptor
|
import okhttp3.logging.HttpLoggingInterceptor
|
||||||
import java.io.File
|
import java.io.File
|
||||||
import java.util.concurrent.TimeUnit
|
import java.util.concurrent.TimeUnit
|
||||||
|
@ -29,6 +30,7 @@ class NetworkHelper(
|
||||||
maxSize = 5L * 1024 * 1024, // 5 MiB
|
maxSize = 5L * 1024 * 1024, // 5 MiB
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
.addInterceptor(BrotliInterceptor)
|
||||||
.addInterceptor(UncaughtExceptionInterceptor())
|
.addInterceptor(UncaughtExceptionInterceptor())
|
||||||
.addInterceptor(UserAgentInterceptor(::defaultUserAgentProvider))
|
.addInterceptor(UserAgentInterceptor(::defaultUserAgentProvider))
|
||||||
|
|
||||||
|
|
|
@ -18,6 +18,7 @@ flowreactivenetwork = "ru.beryukhov:flowreactivenetwork:1.0.4"
|
||||||
|
|
||||||
okhttp-core = { module = "com.squareup.okhttp3:okhttp", version.ref = "okhttp_version" }
|
okhttp-core = { module = "com.squareup.okhttp3:okhttp", version.ref = "okhttp_version" }
|
||||||
okhttp-logging = { module = "com.squareup.okhttp3:logging-interceptor", version.ref = "okhttp_version" }
|
okhttp-logging = { module = "com.squareup.okhttp3:logging-interceptor", version.ref = "okhttp_version" }
|
||||||
|
okhttp-brotli = { module = "com.squareup.okhttp3:okhttp-brotli", version.ref = "okhttp_version" }
|
||||||
okhttp-dnsoverhttps = { module = "com.squareup.okhttp3:okhttp-dnsoverhttps", version.ref = "okhttp_version" }
|
okhttp-dnsoverhttps = { module = "com.squareup.okhttp3:okhttp-dnsoverhttps", version.ref = "okhttp_version" }
|
||||||
okio = "com.squareup.okio:okio:3.6.0"
|
okio = "com.squareup.okio:okio:3.6.0"
|
||||||
|
|
||||||
|
@ -92,7 +93,7 @@ voyager-transitions = { module = "cafe.adriel.voyager:voyager-transitions", vers
|
||||||
ktlint = "org.jlleitschuh.gradle:ktlint-gradle:11.6.1"
|
ktlint = "org.jlleitschuh.gradle:ktlint-gradle:11.6.1"
|
||||||
|
|
||||||
[bundles]
|
[bundles]
|
||||||
okhttp = ["okhttp-core", "okhttp-logging", "okhttp-dnsoverhttps"]
|
okhttp = ["okhttp-core", "okhttp-logging", "okhttp-brotli", "okhttp-dnsoverhttps"]
|
||||||
js-engine = ["quickjs-android"]
|
js-engine = ["quickjs-android"]
|
||||||
sqlite = ["sqlite-framework", "sqlite-ktx", "sqlite-android"]
|
sqlite = ["sqlite-framework", "sqlite-ktx", "sqlite-android"]
|
||||||
coil = ["coil-core", "coil-gif", "coil-compose"]
|
coil = ["coil-core", "coil-gif", "coil-compose"]
|
||||||
|
|
Reference in a new issue