File tree Expand file tree Collapse file tree
src/main/java/org/schabi/newpipe Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -130,7 +130,6 @@ ksp {
130130 arg(" room.schemaLocation" , " $projectDir /schemas" )
131131}
132132
133-
134133// Custom dependency configuration for ktlint
135134val ktlint by configurations.creating
136135
@@ -254,6 +253,7 @@ dependencies {
254253
255254 // HTTP client
256255 implementation(libs.squareup.okhttp)
256+ implementation(libs.squareup.okhttp.brotli)
257257
258258 // Media player
259259 implementation(libs.google.exoplayer.core)
Original file line number Diff line number Diff line change 2323import java .util .stream .Collectors ;
2424import java .util .stream .Stream ;
2525
26+ import okhttp3 .CompressionInterceptor ;
27+ import okhttp3 .Gzip ;
2628import okhttp3 .OkHttpClient ;
2729import okhttp3 .RequestBody ;
2830import okhttp3 .ResponseBody ;
31+ import okhttp3 .brotli .Brotli ;
2932
3033public final class DownloaderImpl extends Downloader {
3134 public static final String USER_AGENT =
@@ -44,6 +47,9 @@ private DownloaderImpl(final OkHttpClient.Builder builder) {
4447 .readTimeout (30 , TimeUnit .SECONDS )
4548// .cache(new Cache(new File(context.getExternalCacheDir(), "okhttp"),
4649// 16 * 1024 * 1024))
50+ .addInterceptor (new CompressionInterceptor (
51+ Brotli .INSTANCE ,
52+ Gzip .INSTANCE ))
4753 .build ();
4854 this .mCookies = new HashMap <>();
4955 }
Original file line number Diff line number Diff line change @@ -127,6 +127,7 @@ squareup-leakcanary-core = { module = "com.squareup.leakcanary:leakcanary-androi
127127squareup-leakcanary-plumber = { module = " com.squareup.leakcanary:plumber-android" , version.ref = " leakcanary" }
128128squareup-leakcanary-watcher = { module = " com.squareup.leakcanary:leakcanary-object-watcher-android" , version.ref = " leakcanary" }
129129squareup-okhttp = { module = " com.squareup.okhttp3:okhttp" , version.ref = " okhttp" }
130+ squareup-okhttp-brotli = { module = " com.squareup.okhttp3:okhttp-brotli" , version.ref = " okhttp" }
130131squareup-picasso = { module = " com.squareup.picasso:picasso" , version.ref = " picasso" }
131132zacsweers-autoservice-compiler = { module = " dev.zacsweers.autoservice:auto-service-ksp" , version.ref = " autoservice-zacsweers" }
132133
You can’t perform that action at this time.
0 commit comments