diff --git a/src/all/mangadex/build.gradle b/src/all/mangadex/build.gradle index ec65d14ad..b052ab7d4 100644 --- a/src/all/mangadex/build.gradle +++ b/src/all/mangadex/build.gradle @@ -5,7 +5,7 @@ ext { extName = 'MangaDex' pkgNameSuffix = 'all.mangadex' extClass = '.MangaDexFactory' - extVersionCode = 102 + extVersionCode = 103 libVersion = '1.2' containsNsfw = true } diff --git a/src/all/mangadex/src/eu/kanade/tachiyomi/extension/all/mangadex/MangaDex.kt b/src/all/mangadex/src/eu/kanade/tachiyomi/extension/all/mangadex/MangaDex.kt index a737df1fa..a142f29ac 100644 --- a/src/all/mangadex/src/eu/kanade/tachiyomi/extension/all/mangadex/MangaDex.kt +++ b/src/all/mangadex/src/eu/kanade/tachiyomi/extension/all/mangadex/MangaDex.kt @@ -71,7 +71,7 @@ abstract class MangaDex( MangadexDescription(internalLang) } - private val rateLimitInterceptor = RateLimitInterceptor(1) + private val rateLimitInterceptor = MdRateLimitInterceptor() override val client: OkHttpClient = network.client.newBuilder() .addNetworkInterceptor(rateLimitInterceptor) @@ -1082,6 +1082,17 @@ class CoverInterceptor : Interceptor { } } +class MdRateLimitInterceptor : Interceptor { + private val coverRegex = Regex("""/images/.*\.jpg""") + private val baseInterceptor = RateLimitInterceptor(1) + + override fun intercept(chain: Interceptor.Chain): Response = + if (chain.request().url().toString().contains(coverRegex)) + chain.proceed(chain.request()) + else + baseInterceptor.intercept(chain) +} + class MdAtHomeReportInterceptor( private val client: OkHttpClient, private val headers: Headers