diff --git a/src/all/koharu/build.gradle b/src/all/koharu/build.gradle index ba938fd65..33efc82dc 100644 --- a/src/all/koharu/build.gradle +++ b/src/all/koharu/build.gradle @@ -1,7 +1,7 @@ ext { extName = 'SchaleNetwork' extClass = '.KoharuFactory' - extVersionCode = 13 + extVersionCode = 14 isNsfw = true } diff --git a/src/all/koharu/src/eu/kanade/tachiyomi/extension/all/koharu/TurnstileInterceptor.kt b/src/all/koharu/src/eu/kanade/tachiyomi/extension/all/koharu/TurnstileInterceptor.kt index 4ee469684..03f103c71 100644 --- a/src/all/koharu/src/eu/kanade/tachiyomi/extension/all/koharu/TurnstileInterceptor.kt +++ b/src/all/koharu/src/eu/kanade/tachiyomi/extension/all/koharu/TurnstileInterceptor.kt @@ -12,6 +12,8 @@ import eu.kanade.tachiyomi.extension.all.koharu.Koharu.Companion.authorization import eu.kanade.tachiyomi.extension.all.koharu.Koharu.Companion.token import eu.kanade.tachiyomi.network.GET import eu.kanade.tachiyomi.network.POST +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.runBlocking import okhttp3.Headers import okhttp3.Interceptor import okhttp3.OkHttpClient @@ -120,7 +122,9 @@ class TurnstileInterceptor( try { val noRedirectClient = client.newBuilder().followRedirects(false).build() val authHeaders = authHeaders(authHeader) - val response = noRedirectClient.newCall(POST(authUrl, authHeaders)).execute() + val response = runBlocking(Dispatchers.IO) { + noRedirectClient.newCall(POST(authUrl, authHeaders)).execute() + } response.use { if (response.isSuccessful) { with(response) { @@ -176,7 +180,9 @@ class TurnstileInterceptor( try { val noRedirectClient = client.newBuilder().followRedirects(false).build() val authHeaders = authHeaders("Bearer $token") - val response = noRedirectClient.newCall(GET(authUrl, authHeaders)).execute() + val response = runBlocking(Dispatchers.IO) { + noRedirectClient.newCall(GET(authUrl, authHeaders)).execute() + } response.use { if (response.isSuccessful) { return true