diff --git a/src/en/snowmtl/build.gradle b/src/en/snowmtl/build.gradle index 31905f7a7..c8ec77737 100644 --- a/src/en/snowmtl/build.gradle +++ b/src/en/snowmtl/build.gradle @@ -1,7 +1,7 @@ ext { extName = 'Snow Machine Translations' extClass = '.Snowmtl' - extVersionCode = 2 + extVersionCode = 3 isNsfw = true } diff --git a/src/en/snowmtl/src/eu/kanade/tachiyomi/extension/en/snowmtl/ComposedImageInterceptor.kt b/src/en/snowmtl/src/eu/kanade/tachiyomi/extension/en/snowmtl/ComposedImageInterceptor.kt index 76ae000cf..31d7b5556 100644 --- a/src/en/snowmtl/src/eu/kanade/tachiyomi/extension/en/snowmtl/ComposedImageInterceptor.kt +++ b/src/en/snowmtl/src/eu/kanade/tachiyomi/extension/en/snowmtl/ComposedImageInterceptor.kt @@ -32,7 +32,7 @@ import kotlin.math.sqrt // The Interceptor joins the captions and pages of the manga. @RequiresApi(Build.VERSION_CODES.O) class ComposedImageInterceptor( - private val baseUrl: String, + baseUrl: String, private val client: OkHttpClient, ) : Interceptor { @@ -44,11 +44,16 @@ class ComposedImageInterceptor( "normal" to Pair("$baseUrl/images/normal.ttf", null), ) + private val imageRegex = Regex( + "$baseUrl.*?\\.(webp|png|jpg|jpeg)#\\[.*?]", + RegexOption.IGNORE_CASE, + ) + override fun intercept(chain: Interceptor.Chain): Response { val request = chain.request() val url = request.url.toString() - val isPageImageUrl = url.contains("${baseUrl.substringAfterLast("/")}/storage/", true) + val isPageImageUrl = imageRegex.containsMatchIn(url) if (isPageImageUrl.not()) { return chain.proceed(request) }