diff --git a/lib/ratelimit/build.gradle.kts b/lib/ratelimit/build.gradle.kts deleted file mode 100644 index e8086827c..000000000 --- a/lib/ratelimit/build.gradle.kts +++ /dev/null @@ -1,22 +0,0 @@ -plugins { - id("com.android.library") - kotlin("android") -} - -android { - compileSdk = AndroidConfig.compileSdk - - defaultConfig { - minSdk = AndroidConfig.minSdk - targetSdk = AndroidConfig.targetSdk - } -} - -repositories { - mavenCentral() -} - -dependencies { - compileOnly(libs.kotlin.stdlib) - compileOnly(libs.okhttp) -} diff --git a/lib/ratelimit/src/main/AndroidManifest.xml b/lib/ratelimit/src/main/AndroidManifest.xml deleted file mode 100644 index a08d6eaff..000000000 --- a/lib/ratelimit/src/main/AndroidManifest.xml +++ /dev/null @@ -1,3 +0,0 @@ - - diff --git a/lib/ratelimit/src/main/java/eu/kanade/tachiyomi/lib/ratelimit/RateLimitInterceptor.kt b/lib/ratelimit/src/main/java/eu/kanade/tachiyomi/lib/ratelimit/RateLimitInterceptor.kt deleted file mode 100644 index 32bcbcb8d..000000000 --- a/lib/ratelimit/src/main/java/eu/kanade/tachiyomi/lib/ratelimit/RateLimitInterceptor.kt +++ /dev/null @@ -1,58 +0,0 @@ -package eu.kanade.tachiyomi.lib.ratelimit - -import android.os.SystemClock -import okhttp3.Interceptor -import okhttp3.Response -import java.util.concurrent.TimeUnit - -/** - * An OkHttp interceptor that handles rate limiting. - * - * Examples: - * - * permits = 5, period = 1, unit = seconds => 5 requests per second - * permits = 10, period = 2, unit = minutes => 10 requests per 2 minutes - * - * @param permits {Int} Number of requests allowed within a period of units. - * @param period {Long} The limiting duration. Defaults to 1. - * @param unit {TimeUnit} The unit of time for the period. Defaults to seconds. - */ -class RateLimitInterceptor( - private val permits: Int, - private val period: Long = 1, - private val unit: TimeUnit = TimeUnit.SECONDS) : Interceptor { - - private val requestQueue = ArrayList(permits) - private val rateLimitMillis = unit.toMillis(period) - - override fun intercept(chain: Interceptor.Chain): Response { - synchronized(requestQueue) { - val now = SystemClock.elapsedRealtime() - val waitTime = if (requestQueue.size < permits) { - 0 - } else { - val oldestReq = requestQueue[0] - val newestReq = requestQueue[permits - 1] - - if (newestReq - oldestReq > rateLimitMillis) { - 0 - } else { - oldestReq + rateLimitMillis - now // Remaining time - } - } - - if (requestQueue.size == permits) { - requestQueue.removeAt(0) - } - if (waitTime > 0) { - requestQueue.add(now + waitTime) - Thread.sleep(waitTime) // Sleep inside synchronized to pause queued requests - } else { - requestQueue.add(now) - } - } - - return chain.proceed(chain.request()) - } - -} diff --git a/lib/ratelimit/src/main/java/eu/kanade/tachiyomi/lib/ratelimit/SpecificHostRateLimitInterceptor.kt b/lib/ratelimit/src/main/java/eu/kanade/tachiyomi/lib/ratelimit/SpecificHostRateLimitInterceptor.kt deleted file mode 100644 index cd2e5cbf0..000000000 --- a/lib/ratelimit/src/main/java/eu/kanade/tachiyomi/lib/ratelimit/SpecificHostRateLimitInterceptor.kt +++ /dev/null @@ -1,65 +0,0 @@ -package eu.kanade.tachiyomi.lib.ratelimit - -import android.os.SystemClock -import okhttp3.HttpUrl -import okhttp3.Interceptor -import okhttp3.Response -import java.util.concurrent.TimeUnit - -/** - * An OkHttp interceptor that handles given url host's rate limiting. - * - * Examples: - * - * httpUrl = "api.manga.com".toHttpUrlOrNull(), permits = 5, period = 1, unit = seconds => 5 requests per second to api.manga.com - * httpUrl = "imagecdn.manga.com".toHttpUrlOrNull(), permits = 10, period = 2, unit = minutes => 10 requests per 2 minutes to imagecdn.manga.com - * - * @param httpUrl {HttpUrl} The url host that this interceptor should handle. Will get url's host by using HttpUrl.host() - * @param permits {Int} Number of requests allowed within a period of units. - * @param period {Long} The limiting duration. Defaults to 1. - * @param unit {TimeUnit} The unit of time for the period. Defaults to seconds. - */ -class SpecificHostRateLimitInterceptor( - private val httpUrl: HttpUrl, - private val permits: Int, - private val period: Long = 1, - private val unit: TimeUnit = TimeUnit.SECONDS -) : Interceptor { - - private val requestQueue = ArrayList(permits) - private val rateLimitMillis = unit.toMillis(period) - private val host = httpUrl.host - - override fun intercept(chain: Interceptor.Chain): Response { - if (chain.request().url.host != host) { - return chain.proceed(chain.request()) - } - synchronized(requestQueue) { - val now = SystemClock.elapsedRealtime() - val waitTime = if (requestQueue.size < permits) { - 0 - } else { - val oldestReq = requestQueue[0] - val newestReq = requestQueue[permits - 1] - - if (newestReq - oldestReq > rateLimitMillis) { - 0 - } else { - oldestReq + rateLimitMillis - now // Remaining time - } - } - - if (requestQueue.size == permits) { - requestQueue.removeAt(0) - } - if (waitTime > 0) { - requestQueue.add(now + waitTime) - Thread.sleep(waitTime) // Sleep inside synchronized to pause queued requests - } else { - requestQueue.add(now) - } - } - - return chain.proceed(chain.request()) - } -} diff --git a/multisrc/overrides/bilibili/bilibilicomics/src/BilibiliComicsFactory.kt b/multisrc/overrides/bilibili/bilibilicomics/src/BilibiliComicsFactory.kt index 2347c68de..35b0dfad6 100644 --- a/multisrc/overrides/bilibili/bilibilicomics/src/BilibiliComicsFactory.kt +++ b/multisrc/overrides/bilibili/bilibilicomics/src/BilibiliComicsFactory.kt @@ -1,6 +1,5 @@ package eu.kanade.tachiyomi.extension.all.bilibilicomics -import eu.kanade.tachiyomi.lib.ratelimit.SpecificHostRateLimitInterceptor import eu.kanade.tachiyomi.multisrc.bilibili.Bilibili import eu.kanade.tachiyomi.multisrc.bilibili.BilibiliAccessToken import eu.kanade.tachiyomi.multisrc.bilibili.BilibiliAccessTokenCookie @@ -12,6 +11,7 @@ import eu.kanade.tachiyomi.multisrc.bilibili.BilibiliTag import eu.kanade.tachiyomi.multisrc.bilibili.BilibiliUnlockedEpisode import eu.kanade.tachiyomi.multisrc.bilibili.BilibiliUserEpisodes import eu.kanade.tachiyomi.network.POST +import eu.kanade.tachiyomi.network.interceptor.rateLimitHost import eu.kanade.tachiyomi.source.SourceFactory import eu.kanade.tachiyomi.source.model.Page import eu.kanade.tachiyomi.source.model.SChapter @@ -46,9 +46,9 @@ abstract class BilibiliComics(lang: String) : Bilibili( override val client: OkHttpClient = super.client.newBuilder() .addInterceptor(::signedInIntercept) .addInterceptor(::expiredTokenIntercept) - .addInterceptor(SpecificHostRateLimitInterceptor(baseUrl.toHttpUrl(), 1)) - .addInterceptor(SpecificHostRateLimitInterceptor(CDN_URL.toHttpUrl(), 2)) - .addInterceptor(SpecificHostRateLimitInterceptor(COVER_CDN_URL.toHttpUrl(), 2)) + .rateLimitHost(baseUrl.toHttpUrl(), 1) + .rateLimitHost(CDN_URL.toHttpUrl(), 2) + .rateLimitHost(COVER_CDN_URL.toHttpUrl(), 2) .build() override val signedIn: Boolean diff --git a/multisrc/overrides/bilibili/bilibilimanga/src/BilibiliManga.kt b/multisrc/overrides/bilibili/bilibilimanga/src/BilibiliManga.kt index adc184751..c76a65f3c 100644 --- a/multisrc/overrides/bilibili/bilibilimanga/src/BilibiliManga.kt +++ b/multisrc/overrides/bilibili/bilibilimanga/src/BilibiliManga.kt @@ -1,10 +1,10 @@ package eu.kanade.tachiyomi.extension.zh.bilibilimanga -import eu.kanade.tachiyomi.lib.ratelimit.SpecificHostRateLimitInterceptor import eu.kanade.tachiyomi.multisrc.bilibili.Bilibili import eu.kanade.tachiyomi.multisrc.bilibili.BilibiliComicDto import eu.kanade.tachiyomi.multisrc.bilibili.BilibiliIntl import eu.kanade.tachiyomi.multisrc.bilibili.BilibiliTag +import eu.kanade.tachiyomi.network.interceptor.rateLimitHost import eu.kanade.tachiyomi.source.model.SChapter import okhttp3.Headers import okhttp3.HttpUrl.Companion.toHttpUrl @@ -21,9 +21,9 @@ class BilibiliManga : Bilibili( override val client: OkHttpClient = super.client.newBuilder() .addInterceptor(::expiredTokenIntercept) - .addInterceptor(SpecificHostRateLimitInterceptor(baseUrl.toHttpUrl(), 1)) - .addInterceptor(SpecificHostRateLimitInterceptor(CDN_URL.toHttpUrl(), 2)) - .addInterceptor(SpecificHostRateLimitInterceptor(COVER_CDN_URL.toHttpUrl(), 2)) + .rateLimitHost(baseUrl.toHttpUrl(), 1) + .rateLimitHost(CDN_URL.toHttpUrl(), 2) + .rateLimitHost(COVER_CDN_URL.toHttpUrl(), 2) .build() override fun headersBuilder() = Headers.Builder().apply { diff --git a/multisrc/overrides/bilibili/default/additional.gradle.kts b/multisrc/overrides/bilibili/default/additional.gradle.kts deleted file mode 100644 index 10beb8157..000000000 --- a/multisrc/overrides/bilibili/default/additional.gradle.kts +++ /dev/null @@ -1,4 +0,0 @@ - -dependencies { - implementation project(':lib-ratelimit') -} diff --git a/multisrc/overrides/foolslide/baixarhentai/src/BaixarHentai.kt b/multisrc/overrides/foolslide/baixarhentai/src/BaixarHentai.kt index 230b408af..82de5e6c4 100644 --- a/multisrc/overrides/foolslide/baixarhentai/src/BaixarHentai.kt +++ b/multisrc/overrides/foolslide/baixarhentai/src/BaixarHentai.kt @@ -1,8 +1,8 @@ package eu.kanade.tachiyomi.extension.pt.baixarhentai import androidx.preference.PreferenceScreen -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.foolslide.FoolSlide +import eu.kanade.tachiyomi.network.interceptor.rateLimit import eu.kanade.tachiyomi.source.model.SManga import org.jsoup.nodes.Document import java.util.concurrent.TimeUnit @@ -12,7 +12,7 @@ class BaixarHentai : FoolSlide("Baixar Hentai", "https://leitura.baixarhentai.ne override val id = 8908032188831949972 override val client = super.client.newBuilder() - .addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) + .rateLimit(1, 2, TimeUnit.SECONDS) .build() override fun mangaDetailsParse(document: Document) = SManga.create().apply { diff --git a/multisrc/overrides/foolslide/default/additional.gradle.kts b/multisrc/overrides/foolslide/default/additional.gradle.kts deleted file mode 100644 index 10beb8157..000000000 --- a/multisrc/overrides/foolslide/default/additional.gradle.kts +++ /dev/null @@ -1,4 +0,0 @@ - -dependencies { - implementation project(':lib-ratelimit') -} diff --git a/multisrc/overrides/foolslide/hentaitokyo/src/HentaiTokyo.kt b/multisrc/overrides/foolslide/hentaitokyo/src/HentaiTokyo.kt deleted file mode 100644 index 19619cec1..000000000 --- a/multisrc/overrides/foolslide/hentaitokyo/src/HentaiTokyo.kt +++ /dev/null @@ -1,17 +0,0 @@ -package eu.kanade.tachiyomi.extension.pt.hentaitokyo - -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor -import eu.kanade.tachiyomi.multisrc.gattsu.Gattsu -import okhttp3.OkHttpClient -import java.util.concurrent.TimeUnit - -class HentaiTokyo : Gattsu( - "Hentai Tokyo", - "https://hentaitokyo.net", - "pt-BR" -) { - - override val client: OkHttpClient = super.client.newBuilder() - .addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) - .build() -} diff --git a/multisrc/overrides/gattsu/default/additional.gradle.kts b/multisrc/overrides/gattsu/default/additional.gradle.kts deleted file mode 100644 index 10beb8157..000000000 --- a/multisrc/overrides/gattsu/default/additional.gradle.kts +++ /dev/null @@ -1,4 +0,0 @@ - -dependencies { - implementation project(':lib-ratelimit') -} diff --git a/multisrc/overrides/gattsu/hentaiseason/src/HentaiSeason.kt b/multisrc/overrides/gattsu/hentaiseason/src/HentaiSeason.kt index 601056796..c15318229 100644 --- a/multisrc/overrides/gattsu/hentaiseason/src/HentaiSeason.kt +++ b/multisrc/overrides/gattsu/hentaiseason/src/HentaiSeason.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.pt.hentaiseason -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.gattsu.Gattsu +import eu.kanade.tachiyomi.network.interceptor.rateLimit import okhttp3.OkHttpClient import java.util.concurrent.TimeUnit @@ -12,6 +12,6 @@ class HentaiSeason : Gattsu( ) { override val client: OkHttpClient = super.client.newBuilder() - .addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) + .rateLimit(1, 2, TimeUnit.SECONDS) .build() } diff --git a/multisrc/overrides/gattsu/hentaitokyo/src/HentaiTokyo.kt b/multisrc/overrides/gattsu/hentaitokyo/src/HentaiTokyo.kt index 19619cec1..ee4e283fd 100644 --- a/multisrc/overrides/gattsu/hentaitokyo/src/HentaiTokyo.kt +++ b/multisrc/overrides/gattsu/hentaitokyo/src/HentaiTokyo.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.pt.hentaitokyo -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.gattsu.Gattsu +import eu.kanade.tachiyomi.network.interceptor.rateLimit import okhttp3.OkHttpClient import java.util.concurrent.TimeUnit @@ -12,6 +12,6 @@ class HentaiTokyo : Gattsu( ) { override val client: OkHttpClient = super.client.newBuilder() - .addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) + .rateLimit(1, 2, TimeUnit.SECONDS) .build() } diff --git a/multisrc/overrides/gattsu/universohentai/src/UniversoHentai.kt b/multisrc/overrides/gattsu/universohentai/src/UniversoHentai.kt index 285637566..af171e174 100644 --- a/multisrc/overrides/gattsu/universohentai/src/UniversoHentai.kt +++ b/multisrc/overrides/gattsu/universohentai/src/UniversoHentai.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.pt.universohentai -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.gattsu.Gattsu +import eu.kanade.tachiyomi.network.interceptor.rateLimit import eu.kanade.tachiyomi.source.model.SChapter import eu.kanade.tachiyomi.source.model.SManga import eu.kanade.tachiyomi.util.asJsoup @@ -18,7 +18,7 @@ class UniversoHentai : Gattsu( ) { override val client: OkHttpClient = super.client.newBuilder() - .addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) + .rateLimit(1, 2, TimeUnit.SECONDS) .build() override fun latestUpdatesSelector() = "div.meio div.videos div.video a[href^=$baseUrl]:not(:has(span.selo-hd))" diff --git a/multisrc/overrides/madara/aiinscan/src/AiinScan.kt b/multisrc/overrides/madara/aiinscan/src/AiinScan.kt index 49e6a5317..15d0d2fa0 100644 --- a/multisrc/overrides/madara/aiinscan/src/AiinScan.kt +++ b/multisrc/overrides/madara/aiinscan/src/AiinScan.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.pt.aiinscan -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.madara.Madara +import eu.kanade.tachiyomi.network.interceptor.rateLimit import okhttp3.OkHttpClient import java.text.SimpleDateFormat import java.util.Locale @@ -15,7 +15,7 @@ class AiinScan : Madara( ) { override val client: OkHttpClient = super.client.newBuilder() - .addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) + .rateLimit(1, 2, TimeUnit.SECONDS) .build() override val useNewChapterEndpoint: Boolean = true diff --git a/multisrc/overrides/madara/akumanotenshi/src/AkumaNoTenshi.kt b/multisrc/overrides/madara/akumanotenshi/src/AkumaNoTenshi.kt index 4abc3591a..570abcbf2 100644 --- a/multisrc/overrides/madara/akumanotenshi/src/AkumaNoTenshi.kt +++ b/multisrc/overrides/madara/akumanotenshi/src/AkumaNoTenshi.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.pt.akumanotenshi -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.madara.Madara +import eu.kanade.tachiyomi.network.interceptor.rateLimit import okhttp3.OkHttpClient import java.text.SimpleDateFormat import java.util.Locale @@ -15,6 +15,6 @@ class AkumaNoTenshi : Madara( ) { override val client: OkHttpClient = super.client.newBuilder() - .addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) + .rateLimit(1, 2, TimeUnit.SECONDS) .build() } diff --git a/multisrc/overrides/madara/animecenterscan/src/AnimeCenterScan.kt b/multisrc/overrides/madara/animecenterscan/src/AnimeCenterScan.kt index 6e2d9f9b0..335e099a2 100644 --- a/multisrc/overrides/madara/animecenterscan/src/AnimeCenterScan.kt +++ b/multisrc/overrides/madara/animecenterscan/src/AnimeCenterScan.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.pt.animecenterscan -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.madara.Madara +import eu.kanade.tachiyomi.network.interceptor.rateLimit import okhttp3.OkHttpClient import java.text.SimpleDateFormat import java.util.Locale @@ -15,6 +15,6 @@ class AnimeCenterScan : Madara( ) { override val client: OkHttpClient = super.client.newBuilder() - .addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) + .rateLimit(1, 2, TimeUnit.SECONDS) .build() } diff --git a/multisrc/overrides/madara/arthurscan/src/ArthurScan.kt b/multisrc/overrides/madara/arthurscan/src/ArthurScan.kt index 76635c12c..2214e064e 100644 --- a/multisrc/overrides/madara/arthurscan/src/ArthurScan.kt +++ b/multisrc/overrides/madara/arthurscan/src/ArthurScan.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.pt.arthurscan -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.madara.Madara +import eu.kanade.tachiyomi.network.interceptor.rateLimit import okhttp3.OkHttpClient import java.text.SimpleDateFormat import java.util.Locale @@ -15,7 +15,7 @@ class ArthurScan : Madara( ) { override val client: OkHttpClient = super.client.newBuilder() - .addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) + .rateLimit(1, 2, TimeUnit.SECONDS) .build() override val useNewChapterEndpoint = true diff --git a/multisrc/overrides/madara/bananamecanica/src/BananaCitrica.kt b/multisrc/overrides/madara/bananamecanica/src/BananaCitrica.kt index 6c577f798..96b701fb3 100644 --- a/multisrc/overrides/madara/bananamecanica/src/BananaCitrica.kt +++ b/multisrc/overrides/madara/bananamecanica/src/BananaCitrica.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.pt.bananamecanica -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.madara.Madara +import eu.kanade.tachiyomi.network.interceptor.rateLimit import okhttp3.OkHttpClient import java.text.SimpleDateFormat import java.util.Locale @@ -18,6 +18,6 @@ class BananaCitrica : Madara( override val id: Long = 4770070980248873010 override val client: OkHttpClient = super.client.newBuilder() - .addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) + .rateLimit(1, 2, TimeUnit.SECONDS) .build() } diff --git a/multisrc/overrides/madara/blmanhwaclub/src/BlManhwaClub.kt b/multisrc/overrides/madara/blmanhwaclub/src/BlManhwaClub.kt index c84f7f2d8..118ee24ae 100644 --- a/multisrc/overrides/madara/blmanhwaclub/src/BlManhwaClub.kt +++ b/multisrc/overrides/madara/blmanhwaclub/src/BlManhwaClub.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.pt.blmanhwaclub -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.madara.Madara +import eu.kanade.tachiyomi.network.interceptor.rateLimit import okhttp3.OkHttpClient import java.text.SimpleDateFormat import java.util.Locale @@ -15,6 +15,6 @@ class BlManhwaClub : Madara( ) { override val client: OkHttpClient = super.client.newBuilder() - .addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) + .rateLimit(1, 2, TimeUnit.SECONDS) .build() } diff --git a/multisrc/overrides/madara/borutoexplorer/src/BorutoExplorer.kt b/multisrc/overrides/madara/borutoexplorer/src/BorutoExplorer.kt index 3c80758c6..e6cc3c05a 100644 --- a/multisrc/overrides/madara/borutoexplorer/src/BorutoExplorer.kt +++ b/multisrc/overrides/madara/borutoexplorer/src/BorutoExplorer.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.pt.borutoexplorer -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.madara.Madara +import eu.kanade.tachiyomi.network.interceptor.rateLimit import okhttp3.OkHttpClient import java.text.SimpleDateFormat import java.util.Locale @@ -15,6 +15,6 @@ class BorutoExplorer : Madara( ) { override val client: OkHttpClient = super.client.newBuilder() - .addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) + .rateLimit(1, 2, TimeUnit.SECONDS) .build() } diff --git a/multisrc/overrides/madara/cafecomyaoi/src/CafeComYaoi.kt b/multisrc/overrides/madara/cafecomyaoi/src/CafeComYaoi.kt index 9090a02ed..fea9b13fd 100644 --- a/multisrc/overrides/madara/cafecomyaoi/src/CafeComYaoi.kt +++ b/multisrc/overrides/madara/cafecomyaoi/src/CafeComYaoi.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.pt.cafecomyaoi -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.madara.Madara +import eu.kanade.tachiyomi.network.interceptor.rateLimit import okhttp3.OkHttpClient import java.text.SimpleDateFormat import java.util.Locale @@ -15,6 +15,6 @@ class CafeComYaoi : Madara( ) { override val client: OkHttpClient = super.client.newBuilder() - .addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) + .rateLimit(1, 2, TimeUnit.SECONDS) .build() } diff --git a/multisrc/overrides/madara/cerisescans/src/CeriseScans.kt b/multisrc/overrides/madara/cerisescans/src/CeriseScans.kt index b7f443491..a7b9989f3 100644 --- a/multisrc/overrides/madara/cerisescans/src/CeriseScans.kt +++ b/multisrc/overrides/madara/cerisescans/src/CeriseScans.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.pt.cerisescans -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.madara.Madara +import eu.kanade.tachiyomi.network.interceptor.rateLimit import okhttp3.OkHttpClient import java.text.SimpleDateFormat import java.util.Locale @@ -15,6 +15,6 @@ class CeriseScans : Madara( ) { override val client: OkHttpClient = super.client.newBuilder() - .addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) + .rateLimit(1, 2, TimeUnit.SECONDS) .build() } diff --git a/multisrc/overrides/madara/covenscan/src/CovenScan.kt b/multisrc/overrides/madara/covenscan/src/CovenScan.kt index 0afaf75df..1985fb849 100644 --- a/multisrc/overrides/madara/covenscan/src/CovenScan.kt +++ b/multisrc/overrides/madara/covenscan/src/CovenScan.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.pt.covenscan -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.madara.Madara +import eu.kanade.tachiyomi.network.interceptor.rateLimit import okhttp3.OkHttpClient import java.text.SimpleDateFormat import java.util.Locale @@ -15,7 +15,7 @@ class CovenScan : Madara( ) { override val client: OkHttpClient = super.client.newBuilder() - .addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) + .rateLimit(1, 2, TimeUnit.SECONDS) .build() override val useNewChapterEndpoint = true diff --git a/multisrc/overrides/madara/cronosscan/src/CronosScan.kt b/multisrc/overrides/madara/cronosscan/src/CronosScan.kt index 62bd492ff..855a9e8a6 100644 --- a/multisrc/overrides/madara/cronosscan/src/CronosScan.kt +++ b/multisrc/overrides/madara/cronosscan/src/CronosScan.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.pt.cronosscan -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.madara.Madara +import eu.kanade.tachiyomi.network.interceptor.rateLimit import okhttp3.OkHttpClient import java.text.SimpleDateFormat import java.util.Locale @@ -15,6 +15,6 @@ class CronosScan : Madara( ) { override val client: OkHttpClient = super.client.newBuilder() - .addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) + .rateLimit(1, 2, TimeUnit.SECONDS) .build() } diff --git a/multisrc/overrides/madara/darkyurealm/src/DarkYueRealm.kt b/multisrc/overrides/madara/darkyurealm/src/DarkYueRealm.kt index c1f169d85..d4ebb8aca 100644 --- a/multisrc/overrides/madara/darkyurealm/src/DarkYueRealm.kt +++ b/multisrc/overrides/madara/darkyurealm/src/DarkYueRealm.kt @@ -1,8 +1,8 @@ package eu.kanade.tachiyomi.extension.pt.darkyurealm -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.madara.Madara import eu.kanade.tachiyomi.network.GET +import eu.kanade.tachiyomi.network.interceptor.rateLimit import eu.kanade.tachiyomi.source.model.SManga import okhttp3.OkHttpClient import okhttp3.Request @@ -21,7 +21,7 @@ class DarkYueRealm : Madara( override val id: Long = 593455310609863709 override val client: OkHttpClient = super.client.newBuilder() - .addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) + .rateLimit(1, 2, TimeUnit.SECONDS) .build() override fun mangaDetailsRequest(manga: SManga): Request { diff --git a/multisrc/overrides/madara/default/additional.gradle.kts b/multisrc/overrides/madara/default/additional.gradle.kts deleted file mode 100644 index 10beb8157..000000000 --- a/multisrc/overrides/madara/default/additional.gradle.kts +++ /dev/null @@ -1,4 +0,0 @@ - -dependencies { - implementation project(':lib-ratelimit') -} diff --git a/multisrc/overrides/madara/diskusscan/src/DiskusScan.kt b/multisrc/overrides/madara/diskusscan/src/DiskusScan.kt index 3fe7473df..a038a371c 100644 --- a/multisrc/overrides/madara/diskusscan/src/DiskusScan.kt +++ b/multisrc/overrides/madara/diskusscan/src/DiskusScan.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.pt.diskusscan -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.madara.Madara +import eu.kanade.tachiyomi.network.interceptor.rateLimit import okhttp3.OkHttpClient import java.text.SimpleDateFormat import java.util.Locale @@ -15,6 +15,6 @@ class DiskusScan : Madara( ) { override val client: OkHttpClient = super.client.newBuilder() - .addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) + .rateLimit(1, 2, TimeUnit.SECONDS) .build() } diff --git a/multisrc/overrides/madara/dreamunionscan/src/DreamUnionScan.kt b/multisrc/overrides/madara/dreamunionscan/src/DreamUnionScan.kt index 029d1938d..c3f5057bd 100644 --- a/multisrc/overrides/madara/dreamunionscan/src/DreamUnionScan.kt +++ b/multisrc/overrides/madara/dreamunionscan/src/DreamUnionScan.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.pt.dreamunionscan -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.madara.Madara +import eu.kanade.tachiyomi.network.interceptor.rateLimit import okhttp3.Interceptor import okhttp3.OkHttpClient import okhttp3.Response @@ -19,7 +19,7 @@ class DreamUnionScan : Madara( override val client: OkHttpClient = super.client.newBuilder() .addInterceptor(::authWarningIntercept) - .addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) + .rateLimit(1, 2, TimeUnit.SECONDS) .build() private fun authWarningIntercept(chain: Interceptor.Chain): Response { diff --git a/multisrc/overrides/madara/dropescan/src/DropeScan.kt b/multisrc/overrides/madara/dropescan/src/DropeScan.kt index ee1ba1e03..1f51d2ba6 100644 --- a/multisrc/overrides/madara/dropescan/src/DropeScan.kt +++ b/multisrc/overrides/madara/dropescan/src/DropeScan.kt @@ -1,8 +1,8 @@ package eu.kanade.tachiyomi.extension.pt.dropescan -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.madara.Madara import eu.kanade.tachiyomi.network.GET +import eu.kanade.tachiyomi.network.interceptor.rateLimit import okhttp3.OkHttpClient import okhttp3.Request import java.text.SimpleDateFormat @@ -17,7 +17,7 @@ class DropeScan : Madara( ) { override val client: OkHttpClient = super.client.newBuilder() - .addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) + .rateLimit(1, 2, TimeUnit.SECONDS) .build() override val useNewChapterEndpoint = true diff --git a/multisrc/overrides/madara/estufadecristal/src/EstufaDeCristal.kt b/multisrc/overrides/madara/estufadecristal/src/EstufaDeCristal.kt index aab21f6dd..7e523cad6 100644 --- a/multisrc/overrides/madara/estufadecristal/src/EstufaDeCristal.kt +++ b/multisrc/overrides/madara/estufadecristal/src/EstufaDeCristal.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.pt.estufadecristal -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.madara.Madara +import eu.kanade.tachiyomi.network.interceptor.rateLimit import eu.kanade.tachiyomi.source.model.SChapter import okhttp3.OkHttpClient import okhttp3.Response @@ -17,7 +17,7 @@ class EstufaDeCristal : Madara( ) { override val client: OkHttpClient = super.client.newBuilder() - .addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) + .rateLimit(1, 2, TimeUnit.SECONDS) .build() override val useNewChapterEndpoint = true diff --git a/multisrc/overrides/madara/fdmscan/src/FDMScan.kt b/multisrc/overrides/madara/fdmscan/src/FDMScan.kt index 6f5418b24..d66cbf199 100644 --- a/multisrc/overrides/madara/fdmscan/src/FDMScan.kt +++ b/multisrc/overrides/madara/fdmscan/src/FDMScan.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.pt.fdmscan -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.madara.Madara +import eu.kanade.tachiyomi.network.interceptor.rateLimit import okhttp3.OkHttpClient import java.text.SimpleDateFormat import java.util.Locale @@ -15,6 +15,6 @@ class FDMScan : Madara( ) { override val client: OkHttpClient = super.client.newBuilder() - .addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) + .rateLimit(1, 2, TimeUnit.SECONDS) .build() } diff --git a/multisrc/overrides/madara/finalscans/src/FinalScans.kt b/multisrc/overrides/madara/finalscans/src/FinalScans.kt index 9824292a8..c1f5a318e 100644 --- a/multisrc/overrides/madara/finalscans/src/FinalScans.kt +++ b/multisrc/overrides/madara/finalscans/src/FinalScans.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.pt.finalscans -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.madara.Madara +import eu.kanade.tachiyomi.network.interceptor.rateLimit import okhttp3.OkHttpClient import java.text.SimpleDateFormat import java.util.Locale @@ -15,6 +15,6 @@ class FinalScans : Madara( ) { override val client: OkHttpClient = super.client.newBuilder() - .addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) + .rateLimit(1, 2, TimeUnit.SECONDS) .build() } diff --git a/multisrc/overrides/madara/firstkissmanga/src/FirstKissManga.kt b/multisrc/overrides/madara/firstkissmanga/src/FirstKissManga.kt index 563bf9d97..616f85170 100644 --- a/multisrc/overrides/madara/firstkissmanga/src/FirstKissManga.kt +++ b/multisrc/overrides/madara/firstkissmanga/src/FirstKissManga.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.en.firstkissmanga -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.madara.Madara +import eu.kanade.tachiyomi.network.interceptor.rateLimit import okhttp3.Headers import java.util.concurrent.TimeUnit @@ -12,9 +12,7 @@ class FirstKissManga : Madara( ) { override fun headersBuilder(): Headers.Builder = super.headersBuilder().add("Referer", baseUrl) - private val rateLimitInterceptor = RateLimitInterceptor(1, 2, TimeUnit.SECONDS) - override val client = network.cloudflareClient.newBuilder() - .addNetworkInterceptor(rateLimitInterceptor) + .rateLimit(1, 2, TimeUnit.SECONDS) .build() } diff --git a/multisrc/overrides/madara/firstkissmangaclub/src/FirstKissMangaClub.kt b/multisrc/overrides/madara/firstkissmangaclub/src/FirstKissMangaClub.kt index 0a9d48e36..6b6f6e9ad 100644 --- a/multisrc/overrides/madara/firstkissmangaclub/src/FirstKissMangaClub.kt +++ b/multisrc/overrides/madara/firstkissmangaclub/src/FirstKissMangaClub.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.en.firstkissmangaclub -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.madara.Madara +import eu.kanade.tachiyomi.network.interceptor.rateLimit import java.util.concurrent.TimeUnit class FirstKissMangaClub : Madara( @@ -9,9 +9,8 @@ class FirstKissMangaClub : Madara( "https://1stkissmanga.club", "en" ) { - private val rateLimitInterceptor = RateLimitInterceptor(1, 2, TimeUnit.SECONDS) override val client = network.cloudflareClient.newBuilder() - .addNetworkInterceptor(rateLimitInterceptor) + .rateLimit(1, 2, TimeUnit.SECONDS) .build() } diff --git a/multisrc/overrides/madara/firstkissmangalove/src/FirstKissMangaLove.kt b/multisrc/overrides/madara/firstkissmangalove/src/FirstKissMangaLove.kt index 3809f2d11..dd62bf008 100644 --- a/multisrc/overrides/madara/firstkissmangalove/src/FirstKissMangaLove.kt +++ b/multisrc/overrides/madara/firstkissmangalove/src/FirstKissMangaLove.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.en.firstkissmangalove -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.madara.Madara +import eu.kanade.tachiyomi.network.interceptor.rateLimit import java.util.concurrent.TimeUnit class FirstKissMangaLove : Madara( @@ -9,9 +9,8 @@ class FirstKissMangaLove : Madara( "https://1stkissmanga.love", "en" ) { - private val rateLimitInterceptor = RateLimitInterceptor(1, 2, TimeUnit.SECONDS) override val client = network.cloudflareClient.newBuilder() - .addNetworkInterceptor(rateLimitInterceptor) + .rateLimit(1, 2, TimeUnit.SECONDS) .build() } diff --git a/multisrc/overrides/madara/firstkissmanhua/src/FirstKissManhua.kt b/multisrc/overrides/madara/firstkissmanhua/src/FirstKissManhua.kt index ff488d514..14462619f 100644 --- a/multisrc/overrides/madara/firstkissmanhua/src/FirstKissManhua.kt +++ b/multisrc/overrides/madara/firstkissmanhua/src/FirstKissManhua.kt @@ -1,8 +1,8 @@ package eu.kanade.tachiyomi.extension.en.firstkissmanhua -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.madara.Madara import eu.kanade.tachiyomi.network.GET +import eu.kanade.tachiyomi.network.interceptor.rateLimit import eu.kanade.tachiyomi.source.model.Page import okhttp3.Request import java.text.SimpleDateFormat @@ -15,10 +15,9 @@ class FirstKissManhua : Madara( "en", SimpleDateFormat("d MMM yyyy", Locale.US) ) { - private val rateLimitInterceptor = RateLimitInterceptor(1, 2, TimeUnit.SECONDS) override val client = network.cloudflareClient.newBuilder() - .addNetworkInterceptor(rateLimitInterceptor) + .rateLimit(1, 2, TimeUnit.SECONDS) .build() override fun imageRequest(page: Page): Request = GET(page.imageUrl!!, headersBuilder().add("Referer", "https://1stkissmanga.com").build()) diff --git a/multisrc/overrides/madara/fleurblanche/src/FleurBlanche.kt b/multisrc/overrides/madara/fleurblanche/src/FleurBlanche.kt index f4df29684..d14911a14 100644 --- a/multisrc/overrides/madara/fleurblanche/src/FleurBlanche.kt +++ b/multisrc/overrides/madara/fleurblanche/src/FleurBlanche.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.pt.fleurblanche -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.madara.Madara +import eu.kanade.tachiyomi.network.interceptor.rateLimit import okhttp3.Headers import okhttp3.Interceptor import okhttp3.OkHttpClient @@ -20,7 +20,7 @@ class FleurBlanche : Madara( override val client: OkHttpClient = super.client.newBuilder() .addInterceptor(::authWarningIntercept) - .addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) + .rateLimit(1, 2, TimeUnit.SECONDS) .build() override val useNewChapterEndpoint = true diff --git a/multisrc/overrides/madara/foxwhite/src/FoxWhite.kt b/multisrc/overrides/madara/foxwhite/src/FoxWhite.kt index 94746bcb2..df83f39b8 100644 --- a/multisrc/overrides/madara/foxwhite/src/FoxWhite.kt +++ b/multisrc/overrides/madara/foxwhite/src/FoxWhite.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.pt.foxwhite -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.madara.Madara +import eu.kanade.tachiyomi.network.interceptor.rateLimit import okhttp3.OkHttpClient import java.text.SimpleDateFormat import java.util.Locale @@ -15,6 +15,6 @@ class FoxWhite : Madara( ) { override val client: OkHttpClient = super.client.newBuilder() - .addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) + .rateLimit(1, 2, TimeUnit.SECONDS) .build() } diff --git a/multisrc/overrides/madara/freemanga/src/FreeManga.kt b/multisrc/overrides/madara/freemanga/src/FreeManga.kt index c84fec67d..561b211d8 100644 --- a/multisrc/overrides/madara/freemanga/src/FreeManga.kt +++ b/multisrc/overrides/madara/freemanga/src/FreeManga.kt @@ -1,13 +1,13 @@ package eu.kanade.tachiyomi.extension.en.freemanga -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.madara.Madara +import eu.kanade.tachiyomi.network.interceptor.rateLimit import okhttp3.OkHttpClient import java.util.concurrent.TimeUnit class FreeManga : Madara("Free Manga", "https://freemanga.me", "en") { override val client: OkHttpClient = super.client.newBuilder() - .addInterceptor(RateLimitInterceptor(1, 1, TimeUnit.SECONDS)) + .rateLimit(1, 1, TimeUnit.SECONDS) .build() } diff --git a/multisrc/overrides/madara/furioscans/src/FurioScans.kt b/multisrc/overrides/madara/furioscans/src/FurioScans.kt index 5e24fb5b0..a130a230a 100644 --- a/multisrc/overrides/madara/furioscans/src/FurioScans.kt +++ b/multisrc/overrides/madara/furioscans/src/FurioScans.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.pt.furioscans -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.madara.Madara +import eu.kanade.tachiyomi.network.interceptor.rateLimit import okhttp3.OkHttpClient import java.text.SimpleDateFormat import java.util.Locale @@ -15,7 +15,7 @@ class FurioScans : Madara( ) { override val client: OkHttpClient = super.client.newBuilder() - .addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) + .rateLimit(1, 2, TimeUnit.SECONDS) .build() override val useNewChapterEndpoint = true diff --git a/multisrc/overrides/madara/glasssky/src/GlassSky.kt b/multisrc/overrides/madara/glasssky/src/GlassSky.kt index afe34ddc4..5f304d0ae 100644 --- a/multisrc/overrides/madara/glasssky/src/GlassSky.kt +++ b/multisrc/overrides/madara/glasssky/src/GlassSky.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.pt.glasssky -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.madara.Madara +import eu.kanade.tachiyomi.network.interceptor.rateLimit import okhttp3.OkHttpClient import java.text.SimpleDateFormat import java.util.Locale @@ -15,6 +15,6 @@ class GlassSky : Madara( ) { override val client: OkHttpClient = super.client.newBuilder() - .addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) + .rateLimit(1, 2, TimeUnit.SECONDS) .build() } diff --git a/multisrc/overrides/madara/gooffansub/src/GoofFansub.kt b/multisrc/overrides/madara/gooffansub/src/GoofFansub.kt index 5563b585b..10fa148ad 100644 --- a/multisrc/overrides/madara/gooffansub/src/GoofFansub.kt +++ b/multisrc/overrides/madara/gooffansub/src/GoofFansub.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.pt.gooffansub -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.madara.Madara +import eu.kanade.tachiyomi.network.interceptor.rateLimit import okhttp3.OkHttpClient import java.text.SimpleDateFormat import java.util.Locale @@ -15,7 +15,7 @@ class GoofFansub : Madara( ) { override val client: OkHttpClient = super.client.newBuilder() - .addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) + .rateLimit(1, 2, TimeUnit.SECONDS) .build() override val popularMangaUrlSelector = "div.post-title a:last-child" diff --git a/multisrc/overrides/madara/helascan/src/HelaScan.kt b/multisrc/overrides/madara/helascan/src/HelaScan.kt index e21904ac7..c06a30336 100644 --- a/multisrc/overrides/madara/helascan/src/HelaScan.kt +++ b/multisrc/overrides/madara/helascan/src/HelaScan.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.pt.helascan -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.madara.Madara +import eu.kanade.tachiyomi.network.interceptor.rateLimit import okhttp3.OkHttpClient import java.text.SimpleDateFormat import java.util.Locale @@ -15,7 +15,7 @@ class HelaScan : Madara( ) { override val client: OkHttpClient = super.client.newBuilder() - .addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) + .rateLimit(1, 2, TimeUnit.SECONDS) .build() override val useNewChapterEndpoint = true diff --git a/multisrc/overrides/madara/hentai20/src/Hentai20.kt b/multisrc/overrides/madara/hentai20/src/Hentai20.kt index 804dedba4..42bff3a9b 100644 --- a/multisrc/overrides/madara/hentai20/src/Hentai20.kt +++ b/multisrc/overrides/madara/hentai20/src/Hentai20.kt @@ -1,13 +1,13 @@ package eu.kanade.tachiyomi.extension.en.hentai20 -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.madara.Madara +import eu.kanade.tachiyomi.network.interceptor.rateLimit import okhttp3.OkHttpClient import java.util.concurrent.TimeUnit class Hentai20 : Madara("Hentai20", "https://hentai20.com", "en") { override val client: OkHttpClient = super.client.newBuilder() - .addInterceptor(RateLimitInterceptor(1, 1, TimeUnit.SECONDS)) + .rateLimit(1, 1, TimeUnit.SECONDS) .build() } diff --git a/multisrc/overrides/madara/hentaidexy/src/Hentaidexy.kt b/multisrc/overrides/madara/hentaidexy/src/Hentaidexy.kt index 537058705..66d67839e 100644 --- a/multisrc/overrides/madara/hentaidexy/src/Hentaidexy.kt +++ b/multisrc/overrides/madara/hentaidexy/src/Hentaidexy.kt @@ -1,13 +1,13 @@ package eu.kanade.tachiyomi.extension.en.hentaidexy -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.madara.Madara +import eu.kanade.tachiyomi.network.interceptor.rateLimit import okhttp3.OkHttpClient import java.util.concurrent.TimeUnit class Hentaidexy : Madara("Hentaidexy", "https://hentaidexy.com", "en") { override val client: OkHttpClient = super.client.newBuilder() - .addInterceptor(RateLimitInterceptor(1, 1, TimeUnit.SECONDS)) + .rateLimit(1, 1, TimeUnit.SECONDS) .build() } diff --git a/multisrc/overrides/madara/hentaiteca/src/HentaiTeca.kt b/multisrc/overrides/madara/hentaiteca/src/HentaiTeca.kt index 65fa1d408..a58338d13 100644 --- a/multisrc/overrides/madara/hentaiteca/src/HentaiTeca.kt +++ b/multisrc/overrides/madara/hentaiteca/src/HentaiTeca.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.pt.hentaiteca -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.madara.Madara +import eu.kanade.tachiyomi.network.interceptor.rateLimit import okhttp3.Headers import okhttp3.OkHttpClient import java.text.SimpleDateFormat @@ -16,7 +16,7 @@ class HentaiTeca : Madara( ) { override val client: OkHttpClient = super.client.newBuilder() - .addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) + .rateLimit(1, 2, TimeUnit.SECONDS) .build() override fun headersBuilder(): Headers.Builder = Headers.Builder() diff --git a/multisrc/overrides/madara/hipercool/src/Hipercool.kt b/multisrc/overrides/madara/hipercool/src/Hipercool.kt index 97fbc938a..1c0b3d7ef 100644 --- a/multisrc/overrides/madara/hipercool/src/Hipercool.kt +++ b/multisrc/overrides/madara/hipercool/src/Hipercool.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.pt.hipercool -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.madara.Madara +import eu.kanade.tachiyomi.network.interceptor.rateLimit import okhttp3.OkHttpClient import java.util.concurrent.TimeUnit @@ -11,6 +11,6 @@ class Hipercool : Madara("HipercooL", "https://hipercool.xyz", "pt-BR") { override val versionId = 2 override val client: OkHttpClient = super.client.newBuilder() - .addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) + .rateLimit(1, 2, TimeUnit.SECONDS) .build() } diff --git a/multisrc/overrides/madara/huntersscan/src/HuntersScan.kt b/multisrc/overrides/madara/huntersscan/src/HuntersScan.kt index 8ed8dd673..aed43a218 100644 --- a/multisrc/overrides/madara/huntersscan/src/HuntersScan.kt +++ b/multisrc/overrides/madara/huntersscan/src/HuntersScan.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.pt.huntersscan -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.madara.Madara +import eu.kanade.tachiyomi.network.interceptor.rateLimit import okhttp3.OkHttpClient import java.text.SimpleDateFormat import java.util.Locale @@ -15,6 +15,6 @@ class HuntersScan : Madara( ) { override val client: OkHttpClient = super.client.newBuilder() - .addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) + .rateLimit(1, 2, TimeUnit.SECONDS) .build() } diff --git a/multisrc/overrides/madara/ichirinnohanayuri/src/IchirinNoHanaYuri.kt b/multisrc/overrides/madara/ichirinnohanayuri/src/IchirinNoHanaYuri.kt index 1008acaf3..82e7aaf75 100644 --- a/multisrc/overrides/madara/ichirinnohanayuri/src/IchirinNoHanaYuri.kt +++ b/multisrc/overrides/madara/ichirinnohanayuri/src/IchirinNoHanaYuri.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.pt.ichirinnohanayuri -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.madara.Madara +import eu.kanade.tachiyomi.network.interceptor.rateLimit import okhttp3.Headers import okhttp3.OkHttpClient import java.io.IOException @@ -17,7 +17,7 @@ class IchirinNoHanaYuri : Madara( ) { override val client: OkHttpClient = super.client.newBuilder() - .addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) + .rateLimit(1, 2, TimeUnit.SECONDS) .addInterceptor { chain -> val response = chain.proceed(chain.request()) diff --git a/multisrc/overrides/madara/imperioscans/src/ImperioScans.kt b/multisrc/overrides/madara/imperioscans/src/ImperioScans.kt index 3cc4cdf17..a97374ad0 100644 --- a/multisrc/overrides/madara/imperioscans/src/ImperioScans.kt +++ b/multisrc/overrides/madara/imperioscans/src/ImperioScans.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.pt.imperioscans -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.madara.Madara +import eu.kanade.tachiyomi.network.interceptor.rateLimit import okhttp3.OkHttpClient import java.text.SimpleDateFormat import java.util.Locale @@ -15,6 +15,6 @@ class ImperioScans : Madara( ) { override val client: OkHttpClient = super.client.newBuilder() - .addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) + .rateLimit(1, 2, TimeUnit.SECONDS) .build() } diff --git a/multisrc/overrides/madara/kamisamaexplorer/src/KamiSamaExplorer.kt b/multisrc/overrides/madara/kamisamaexplorer/src/KamiSamaExplorer.kt index a85f94d12..eb0b63838 100644 --- a/multisrc/overrides/madara/kamisamaexplorer/src/KamiSamaExplorer.kt +++ b/multisrc/overrides/madara/kamisamaexplorer/src/KamiSamaExplorer.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.pt.kamisamaexplorer -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.madara.Madara +import eu.kanade.tachiyomi.network.interceptor.rateLimit import okhttp3.OkHttpClient import java.text.SimpleDateFormat import java.util.Locale @@ -15,6 +15,6 @@ class KamiSamaExplorer : Madara( ) { override val client: OkHttpClient = super.client.newBuilder() - .addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) + .rateLimit(1, 2, TimeUnit.SECONDS) .build() } diff --git a/multisrc/overrides/madara/limascans/src/LimaScans.kt b/multisrc/overrides/madara/limascans/src/LimaScans.kt index 96bca2ef1..04cc8d922 100644 --- a/multisrc/overrides/madara/limascans/src/LimaScans.kt +++ b/multisrc/overrides/madara/limascans/src/LimaScans.kt @@ -1,8 +1,8 @@ package eu.kanade.tachiyomi.extension.pt.limascans -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.madara.Madara import eu.kanade.tachiyomi.network.GET +import eu.kanade.tachiyomi.network.interceptor.rateLimit import eu.kanade.tachiyomi.source.model.SManga import okhttp3.OkHttpClient import okhttp3.Request @@ -18,7 +18,7 @@ class LimaScans : Madara( ) { override val client: OkHttpClient = super.client.newBuilder() - .addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) + .rateLimit(1, 2, TimeUnit.SECONDS) .build() override fun mangaDetailsRequest(manga: SManga): Request { diff --git a/multisrc/overrides/madara/littlemonsterscan/src/LittleMonsterScan.kt b/multisrc/overrides/madara/littlemonsterscan/src/LittleMonsterScan.kt index 338d5c1e7..3a0b5cc88 100644 --- a/multisrc/overrides/madara/littlemonsterscan/src/LittleMonsterScan.kt +++ b/multisrc/overrides/madara/littlemonsterscan/src/LittleMonsterScan.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.pt.littlemonsterscan -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.madara.Madara +import eu.kanade.tachiyomi.network.interceptor.rateLimit import okhttp3.OkHttpClient import java.text.SimpleDateFormat import java.util.Locale @@ -15,7 +15,7 @@ class LittleMonsterScan : Madara( ) { override val client: OkHttpClient = super.client.newBuilder() - .addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) + .rateLimit(1, 2, TimeUnit.SECONDS) .build() override val altName: String = "Nome alternativo: " diff --git a/multisrc/overrides/madara/mangaclash/src/MangaClash.kt b/multisrc/overrides/madara/mangaclash/src/MangaClash.kt index 6fc88ce90..fad6504c2 100644 --- a/multisrc/overrides/madara/mangaclash/src/MangaClash.kt +++ b/multisrc/overrides/madara/mangaclash/src/MangaClash.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.en.mangaclash -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.madara.Madara +import eu.kanade.tachiyomi.network.interceptor.rateLimit import okhttp3.OkHttpClient import java.text.SimpleDateFormat import java.util.Locale @@ -15,6 +15,6 @@ class MangaClash : Madara( ) { override val client: OkHttpClient = super.client.newBuilder() - .addInterceptor(RateLimitInterceptor(1, 1, TimeUnit.SECONDS)) + .rateLimit(1, 1, TimeUnit.SECONDS) .build() } diff --git a/multisrc/overrides/madara/mangafenix/src/MangaFenix.kt b/multisrc/overrides/madara/mangafenix/src/MangaFenix.kt index 6f8633286..7357bb7ce 100644 --- a/multisrc/overrides/madara/mangafenix/src/MangaFenix.kt +++ b/multisrc/overrides/madara/mangafenix/src/MangaFenix.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.es.mangafenix -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.madara.Madara +import eu.kanade.tachiyomi.network.interceptor.rateLimit import okhttp3.OkHttpClient import java.text.SimpleDateFormat import java.util.Locale @@ -14,6 +14,6 @@ class MangaFenix : Madara( ) { override val client: OkHttpClient = super.client.newBuilder() - .addInterceptor(RateLimitInterceptor(1)) + .rateLimit(1) .build() } diff --git a/multisrc/overrides/madara/mangaforfree/src/MangaForFreeFactory.kt b/multisrc/overrides/madara/mangaforfree/src/MangaForFreeFactory.kt index 1249fb595..f57443ce6 100644 --- a/multisrc/overrides/madara/mangaforfree/src/MangaForFreeFactory.kt +++ b/multisrc/overrides/madara/mangaforfree/src/MangaForFreeFactory.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.all.mangaforfree -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.madara.Madara +import eu.kanade.tachiyomi.network.interceptor.rateLimit import eu.kanade.tachiyomi.source.Source import eu.kanade.tachiyomi.source.SourceFactory import okhttp3.OkHttpClient @@ -29,6 +29,6 @@ abstract class MangaForFree( ) : Madara(name, baseUrl, lang) { override val client: OkHttpClient = super.client.newBuilder() - .addInterceptor(RateLimitInterceptor(1, 1, TimeUnit.SECONDS)) + .rateLimit(1, 1, TimeUnit.SECONDS) .build() } diff --git a/multisrc/overrides/madara/mangakomi/src/MangaKomi.kt b/multisrc/overrides/madara/mangakomi/src/MangaKomi.kt index 7910f26bb..e0d999aa4 100644 --- a/multisrc/overrides/madara/mangakomi/src/MangaKomi.kt +++ b/multisrc/overrides/madara/mangakomi/src/MangaKomi.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.en.mangakomi -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.madara.Madara +import eu.kanade.tachiyomi.network.interceptor.rateLimit import okhttp3.OkHttpClient import java.util.concurrent.TimeUnit @@ -12,6 +12,6 @@ class MangaKomi : Madara( ) { override val client: OkHttpClient = super.client.newBuilder() - .addInterceptor(RateLimitInterceptor(1, 1, TimeUnit.SECONDS)) + .rateLimit(1, 1, TimeUnit.SECONDS) .build() } diff --git a/multisrc/overrides/madara/mangatuli/src/MangaTuli.kt b/multisrc/overrides/madara/mangatuli/src/MangaTuli.kt index a62622baf..e5929f80b 100644 --- a/multisrc/overrides/madara/mangatuli/src/MangaTuli.kt +++ b/multisrc/overrides/madara/mangatuli/src/MangaTuli.kt @@ -1,13 +1,13 @@ package eu.kanade.tachiyomi.extension.en.mangatuli -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.madara.Madara +import eu.kanade.tachiyomi.network.interceptor.rateLimit import okhttp3.OkHttpClient import java.util.concurrent.TimeUnit class MangaTuli : Madara("MangaTuli", "https://mangatuli.com", "en") { override val client: OkHttpClient = super.client.newBuilder() - .addInterceptor(RateLimitInterceptor(1, 1, TimeUnit.SECONDS)) + .rateLimit(1, 1, TimeUnit.SECONDS) .build() } diff --git a/multisrc/overrides/madara/manhuapro/src/ManhuaPro.kt b/multisrc/overrides/madara/manhuapro/src/ManhuaPro.kt index 89d7ef636..7278c406a 100644 --- a/multisrc/overrides/madara/manhuapro/src/ManhuaPro.kt +++ b/multisrc/overrides/madara/manhuapro/src/ManhuaPro.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.en.manhuapro -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.madara.Madara +import eu.kanade.tachiyomi.network.interceptor.rateLimit import okhttp3.OkHttpClient import java.util.concurrent.TimeUnit @@ -12,6 +12,6 @@ class ManhuaPro : Madara( ) { override val client: OkHttpClient = super.client.newBuilder() - .addInterceptor(RateLimitInterceptor(1, 1, TimeUnit.SECONDS)) + .rateLimit(1, 1, TimeUnit.SECONDS) .build() } diff --git a/multisrc/overrides/madara/markscans/src/MarkScans.kt b/multisrc/overrides/madara/markscans/src/MarkScans.kt index 03f5fd8e0..c18c326a0 100644 --- a/multisrc/overrides/madara/markscans/src/MarkScans.kt +++ b/multisrc/overrides/madara/markscans/src/MarkScans.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.pt.markscans -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.madara.Madara +import eu.kanade.tachiyomi.network.interceptor.rateLimit import okhttp3.OkHttpClient import java.text.SimpleDateFormat import java.util.Locale @@ -15,6 +15,6 @@ class MarkScans : Madara( ) { override val client: OkHttpClient = super.client.newBuilder() - .addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) + .rateLimit(1, 2, TimeUnit.SECONDS) .build() } diff --git a/multisrc/overrides/madara/mhentais/src/MHentais.kt b/multisrc/overrides/madara/mhentais/src/MHentais.kt index df70b2543..c534b1dd4 100644 --- a/multisrc/overrides/madara/mhentais/src/MHentais.kt +++ b/multisrc/overrides/madara/mhentais/src/MHentais.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.pt.mhentais -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.madara.Madara +import eu.kanade.tachiyomi.network.interceptor.rateLimit import okhttp3.OkHttpClient import java.text.SimpleDateFormat import java.util.Locale @@ -15,6 +15,6 @@ class MHentais : Madara( ) { override val client: OkHttpClient = super.client.newBuilder() - .addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) + .rateLimit(1, 2, TimeUnit.SECONDS) .build() } diff --git a/multisrc/overrides/madara/minitwoscan/src/MiniTwoScan.kt b/multisrc/overrides/madara/minitwoscan/src/MiniTwoScan.kt index 879ad1704..aef18b425 100644 --- a/multisrc/overrides/madara/minitwoscan/src/MiniTwoScan.kt +++ b/multisrc/overrides/madara/minitwoscan/src/MiniTwoScan.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.pt.minitwoscan -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.madara.Madara +import eu.kanade.tachiyomi.network.interceptor.rateLimit import okhttp3.OkHttpClient import java.text.SimpleDateFormat import java.util.Locale @@ -15,6 +15,6 @@ class MiniTwoScan : Madara( ) { override val client: OkHttpClient = super.client.newBuilder() - .addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) + .rateLimit(1, 2, TimeUnit.SECONDS) .build() } diff --git a/multisrc/overrides/madara/miradscanlator/src/MiradScanlator.kt b/multisrc/overrides/madara/miradscanlator/src/MiradScanlator.kt index 555dc3016..4c32bd857 100644 --- a/multisrc/overrides/madara/miradscanlator/src/MiradScanlator.kt +++ b/multisrc/overrides/madara/miradscanlator/src/MiradScanlator.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.pt.miradscanlator -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.madara.Madara +import eu.kanade.tachiyomi.network.interceptor.rateLimit import okhttp3.OkHttpClient import java.text.SimpleDateFormat import java.util.Locale @@ -15,6 +15,6 @@ class MiradScanlator : Madara( ) { override val client: OkHttpClient = super.client.newBuilder() - .addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) + .rateLimit(1, 2, TimeUnit.SECONDS) .build() } diff --git a/multisrc/overrides/madara/momonohanascan/src/MomoNoHanaScan.kt b/multisrc/overrides/madara/momonohanascan/src/MomoNoHanaScan.kt index 68bb5b95b..754c116fb 100644 --- a/multisrc/overrides/madara/momonohanascan/src/MomoNoHanaScan.kt +++ b/multisrc/overrides/madara/momonohanascan/src/MomoNoHanaScan.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.pt.momonohanascan -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.madara.Madara +import eu.kanade.tachiyomi.network.interceptor.rateLimit import okhttp3.OkHttpClient import java.text.SimpleDateFormat import java.util.Locale @@ -15,7 +15,7 @@ class MomoNoHanaScan : Madara( ) { override val client: OkHttpClient = super.client.newBuilder() - .addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) + .rateLimit(1, 2, TimeUnit.SECONDS) .build() override val useNewChapterEndpoint = true diff --git a/multisrc/overrides/madara/nekobreakerscan/src/NekoBreakerScan.kt b/multisrc/overrides/madara/nekobreakerscan/src/NekoBreakerScan.kt index 3f3fae2d0..bd73ef7fa 100644 --- a/multisrc/overrides/madara/nekobreakerscan/src/NekoBreakerScan.kt +++ b/multisrc/overrides/madara/nekobreakerscan/src/NekoBreakerScan.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.pt.nekobreakerscan -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.madara.Madara +import eu.kanade.tachiyomi.network.interceptor.rateLimit import okhttp3.OkHttpClient import java.text.SimpleDateFormat import java.util.Locale @@ -15,6 +15,6 @@ class NekoBreakerScan : Madara( ) { override val client: OkHttpClient = super.client.newBuilder() - .addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) + .rateLimit(1, 2, TimeUnit.SECONDS) .build() } diff --git a/multisrc/overrides/madara/neoxscanlator/src/NeoxScanlator.kt b/multisrc/overrides/madara/neoxscanlator/src/NeoxScanlator.kt index 4206c3a31..6995bdac9 100644 --- a/multisrc/overrides/madara/neoxscanlator/src/NeoxScanlator.kt +++ b/multisrc/overrides/madara/neoxscanlator/src/NeoxScanlator.kt @@ -6,11 +6,11 @@ import android.widget.Toast import androidx.preference.EditTextPreference import androidx.preference.PreferenceScreen import eu.kanade.tachiyomi.AppInfo -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.madara.Madara import eu.kanade.tachiyomi.network.GET import eu.kanade.tachiyomi.network.POST import eu.kanade.tachiyomi.network.asObservable +import eu.kanade.tachiyomi.network.interceptor.rateLimit import eu.kanade.tachiyomi.source.ConfigurableSource import eu.kanade.tachiyomi.source.model.MangasPage import eu.kanade.tachiyomi.source.model.Page @@ -50,7 +50,7 @@ class NeoxScanlator : .readTimeout(1, TimeUnit.MINUTES) .addInterceptor(::titleCollectionIntercept) .addInterceptor(::obsoleteCheckIntercept) - .addInterceptor(RateLimitInterceptor(1, 3, TimeUnit.SECONDS)) + .rateLimit(1, 2, TimeUnit.SECONDS) .build() override val altNameSelector = ".post-content_item:contains(Alternativo) .summary-content" diff --git a/multisrc/overrides/madara/ninjascan/src/NinjaScan.kt b/multisrc/overrides/madara/ninjascan/src/NinjaScan.kt index 5280f5eb4..10bab4dff 100644 --- a/multisrc/overrides/madara/ninjascan/src/NinjaScan.kt +++ b/multisrc/overrides/madara/ninjascan/src/NinjaScan.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.pt.ninjascan -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.madara.Madara +import eu.kanade.tachiyomi.network.interceptor.rateLimit import okhttp3.OkHttpClient import java.text.SimpleDateFormat import java.util.Locale @@ -15,6 +15,6 @@ class NinjaScan : Madara( ) { override val client: OkHttpClient = super.client.newBuilder() - .addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) + .rateLimit(1, 2, TimeUnit.SECONDS) .build() } diff --git a/multisrc/overrides/madara/owscan/src/OwScan.kt b/multisrc/overrides/madara/owscan/src/OwScan.kt index a6abf3fb4..8a1a72820 100644 --- a/multisrc/overrides/madara/owscan/src/OwScan.kt +++ b/multisrc/overrides/madara/owscan/src/OwScan.kt @@ -1,13 +1,13 @@ package eu.kanade.tachiyomi.extension.pt.owscan -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.madara.Madara +import eu.kanade.tachiyomi.network.interceptor.rateLimit import okhttp3.OkHttpClient import java.util.concurrent.TimeUnit class OwScan : Madara("Ow Scan", "https://owscan.com", "pt-BR") { override val client: OkHttpClient = super.client.newBuilder() - .addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) + .rateLimit(1, 2, TimeUnit.SECONDS) .build() } diff --git a/multisrc/overrides/madara/pirulitorosa/src/PirulitoRosa.kt b/multisrc/overrides/madara/pirulitorosa/src/PirulitoRosa.kt index efea3ea57..5f7794a80 100644 --- a/multisrc/overrides/madara/pirulitorosa/src/PirulitoRosa.kt +++ b/multisrc/overrides/madara/pirulitorosa/src/PirulitoRosa.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.pt.pirulitorosa -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.madara.Madara +import eu.kanade.tachiyomi.network.interceptor.rateLimit import okhttp3.OkHttpClient import java.text.SimpleDateFormat import java.util.Locale @@ -15,7 +15,7 @@ class PirulitoRosa : Madara( ) { override val client: OkHttpClient = super.client.newBuilder() - .addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) + .rateLimit(1, 2, TimeUnit.SECONDS) .build() override val popularMangaUrlSelector = "div.post-title a:last-child" diff --git a/multisrc/overrides/madara/prismahentais/src/PrismaHentais.kt b/multisrc/overrides/madara/prismahentais/src/PrismaHentais.kt index 5f23cb95e..d205c5c0d 100644 --- a/multisrc/overrides/madara/prismahentais/src/PrismaHentais.kt +++ b/multisrc/overrides/madara/prismahentais/src/PrismaHentais.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.pt.prismahentais -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.madara.Madara +import eu.kanade.tachiyomi.network.interceptor.rateLimit import okhttp3.OkHttpClient import java.text.SimpleDateFormat import java.util.Locale @@ -15,6 +15,6 @@ class PrismaHentais : Madara( ) { override val client: OkHttpClient = super.client.newBuilder() - .addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) + .rateLimit(1, 2, TimeUnit.SECONDS) .build() } diff --git a/multisrc/overrides/madara/prismascans/src/PrismaScans.kt b/multisrc/overrides/madara/prismascans/src/PrismaScans.kt index ecedb3329..3fabb6eb9 100644 --- a/multisrc/overrides/madara/prismascans/src/PrismaScans.kt +++ b/multisrc/overrides/madara/prismascans/src/PrismaScans.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.pt.prismascans -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.madara.Madara +import eu.kanade.tachiyomi.network.interceptor.rateLimit import okhttp3.OkHttpClient import java.text.SimpleDateFormat import java.util.Locale @@ -15,7 +15,7 @@ class PrismaScans : Madara( ) { override val client: OkHttpClient = super.client.newBuilder() - .addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) + .rateLimit(1, 2, TimeUnit.SECONDS) .build() override val useNewChapterEndpoint = true diff --git a/multisrc/overrides/madara/projetoscanlator/src/ProjetoScanlator.kt b/multisrc/overrides/madara/projetoscanlator/src/ProjetoScanlator.kt index 43409f571..eafc5a0dc 100644 --- a/multisrc/overrides/madara/projetoscanlator/src/ProjetoScanlator.kt +++ b/multisrc/overrides/madara/projetoscanlator/src/ProjetoScanlator.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.pt.projetoscanlator -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.madara.Madara +import eu.kanade.tachiyomi.network.interceptor.rateLimit import okhttp3.OkHttpClient import java.text.SimpleDateFormat import java.util.Locale @@ -15,6 +15,6 @@ class ProjetoScanlator : Madara( ) { override val client: OkHttpClient = super.client.newBuilder() - .addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) + .rateLimit(1, 2, TimeUnit.SECONDS) .build() } diff --git a/multisrc/overrides/madara/randomscan/src/RandomScan.kt b/multisrc/overrides/madara/randomscan/src/RandomScan.kt index 12e50c63d..6e299bf1b 100644 --- a/multisrc/overrides/madara/randomscan/src/RandomScan.kt +++ b/multisrc/overrides/madara/randomscan/src/RandomScan.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.pt.randomscan -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.madara.Madara +import eu.kanade.tachiyomi.network.interceptor.rateLimit import okhttp3.OkHttpClient import java.text.SimpleDateFormat import java.util.Locale @@ -15,6 +15,6 @@ class RandomScan : Madara( ) { override val client: OkHttpClient = super.client.newBuilder() - .addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) + .rateLimit(1, 2, TimeUnit.SECONDS) .build() } diff --git a/multisrc/overrides/madara/reaperscans/src/ReaperScansFactory.kt b/multisrc/overrides/madara/reaperscans/src/ReaperScansFactory.kt index 4a54d5833..e7ef38ccf 100644 --- a/multisrc/overrides/madara/reaperscans/src/ReaperScansFactory.kt +++ b/multisrc/overrides/madara/reaperscans/src/ReaperScansFactory.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.all.reaperscans -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.madara.Madara +import eu.kanade.tachiyomi.network.interceptor.rateLimit import eu.kanade.tachiyomi.source.SourceFactory import eu.kanade.tachiyomi.source.model.SChapter import okhttp3.HttpUrl.Companion.toHttpUrl @@ -62,7 +62,7 @@ class ReaperScansBr : ReaperScans( override val id = 7767018058145795388 override val client: OkHttpClient = super.client.newBuilder() - .addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) + .rateLimit(1, 2, TimeUnit.SECONDS) .build() } diff --git a/multisrc/overrides/madara/remangas/src/Remangas.kt b/multisrc/overrides/madara/remangas/src/Remangas.kt index 28d8d726e..fa93018c0 100644 --- a/multisrc/overrides/madara/remangas/src/Remangas.kt +++ b/multisrc/overrides/madara/remangas/src/Remangas.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.pt.remangas -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.madara.Madara +import eu.kanade.tachiyomi.network.interceptor.rateLimit import okhttp3.OkHttpClient import java.text.SimpleDateFormat import java.util.Locale @@ -18,6 +18,6 @@ class Remangas : Madara( override val useNewChapterEndpoint = true override val client: OkHttpClient = super.client.newBuilder() - .addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) + .rateLimit(1, 2, TimeUnit.SECONDS) .build() } diff --git a/multisrc/overrides/madara/rwbyscan/src/RwbyScan.kt b/multisrc/overrides/madara/rwbyscan/src/RwbyScan.kt index e98ea3338..7db605eff 100644 --- a/multisrc/overrides/madara/rwbyscan/src/RwbyScan.kt +++ b/multisrc/overrides/madara/rwbyscan/src/RwbyScan.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.pt.rwbyscan -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.madara.Madara +import eu.kanade.tachiyomi.network.interceptor.rateLimit import okhttp3.OkHttpClient import java.text.SimpleDateFormat import java.util.Locale @@ -15,6 +15,6 @@ class RwbyScan : Madara( ) { override val client: OkHttpClient = super.client.newBuilder() - .addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) + .rateLimit(1, 2, TimeUnit.SECONDS) .build() } diff --git a/multisrc/overrides/madara/seikouscans/src/SeikouScans.kt b/multisrc/overrides/madara/seikouscans/src/SeikouScans.kt index b3c450b52..e92290b5a 100644 --- a/multisrc/overrides/madara/seikouscans/src/SeikouScans.kt +++ b/multisrc/overrides/madara/seikouscans/src/SeikouScans.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.pt.seikouscans -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.madara.Madara +import eu.kanade.tachiyomi.network.interceptor.rateLimit import okhttp3.OkHttpClient import java.text.SimpleDateFormat import java.util.Locale @@ -15,7 +15,7 @@ class SeikouScans : Madara( ) { override val client: OkHttpClient = super.client.newBuilder() - .addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) + .rateLimit(1, 2, TimeUnit.SECONDS) .build() override val useNewChapterEndpoint = true diff --git a/multisrc/overrides/madara/sensainayuri/src/SensainaYuri.kt b/multisrc/overrides/madara/sensainayuri/src/SensainaYuri.kt index a39a9b2b8..a39560c25 100644 --- a/multisrc/overrides/madara/sensainayuri/src/SensainaYuri.kt +++ b/multisrc/overrides/madara/sensainayuri/src/SensainaYuri.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.pt.sensainayuri -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.madara.Madara +import eu.kanade.tachiyomi.network.interceptor.rateLimit import okhttp3.OkHttpClient import java.text.SimpleDateFormat import java.util.Locale @@ -15,7 +15,7 @@ class SensainaYuri : Madara( ) { override val client: OkHttpClient = super.client.newBuilder() - .addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) + .rateLimit(1, 2, TimeUnit.SECONDS) .build() override val useNewChapterEndpoint = true diff --git a/multisrc/overrides/madara/shieldmanga/src/ShieldManga.kt b/multisrc/overrides/madara/shieldmanga/src/ShieldManga.kt index 66baef10a..0412ca599 100644 --- a/multisrc/overrides/madara/shieldmanga/src/ShieldManga.kt +++ b/multisrc/overrides/madara/shieldmanga/src/ShieldManga.kt @@ -1,17 +1,16 @@ package eu.kanade.tachiyomi.extension.en.shieldmanga -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.madara.Madara +import eu.kanade.tachiyomi.network.interceptor.rateLimit import okhttp3.OkHttpClient import java.util.concurrent.TimeUnit class ShieldManga : Madara("Shield Manga", "https://shieldmanga.io", "en") { - private val rateLimitInterceptor = RateLimitInterceptor(1) override val client: OkHttpClient = network.cloudflareClient.newBuilder() .connectTimeout(10, TimeUnit.SECONDS) .readTimeout(30, TimeUnit.SECONDS) - .addNetworkInterceptor(rateLimitInterceptor) + .rateLimit(1) .build() // The website does not flag the content. diff --git a/multisrc/overrides/madara/shinzooscan/src/ShinzooScan.kt b/multisrc/overrides/madara/shinzooscan/src/ShinzooScan.kt index 1247744dc..c941deade 100644 --- a/multisrc/overrides/madara/shinzooscan/src/ShinzooScan.kt +++ b/multisrc/overrides/madara/shinzooscan/src/ShinzooScan.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.pt.shinzooscan -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.madara.Madara +import eu.kanade.tachiyomi.network.interceptor.rateLimit import okhttp3.OkHttpClient import java.text.SimpleDateFormat import java.util.Locale @@ -15,6 +15,6 @@ class ShinzooScan : Madara( ) { override val client: OkHttpClient = super.client.newBuilder() - .addInterceptor(RateLimitInterceptor(1, 1, TimeUnit.SECONDS)) + .rateLimit(1, 1, TimeUnit.SECONDS) .build() } diff --git a/multisrc/overrides/madara/sinensis/src/Sinensis.kt b/multisrc/overrides/madara/sinensis/src/Sinensis.kt index d1e4556d2..ad2c38faa 100644 --- a/multisrc/overrides/madara/sinensis/src/Sinensis.kt +++ b/multisrc/overrides/madara/sinensis/src/Sinensis.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.pt.sinensis -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.madara.Madara +import eu.kanade.tachiyomi.network.interceptor.rateLimit import okhttp3.OkHttpClient import java.text.SimpleDateFormat import java.util.Locale @@ -15,6 +15,6 @@ class Sinensis : Madara( ) { override val client: OkHttpClient = super.client.newBuilder() - .addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) + .rateLimit(1, 2, TimeUnit.SECONDS) .build() } diff --git a/multisrc/overrides/madara/smashscan/src/SmashScan.kt b/multisrc/overrides/madara/smashscan/src/SmashScan.kt index 7d141b897..9fd6eb4d0 100644 --- a/multisrc/overrides/madara/smashscan/src/SmashScan.kt +++ b/multisrc/overrides/madara/smashscan/src/SmashScan.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.pt.smashscan -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.madara.Madara +import eu.kanade.tachiyomi.network.interceptor.rateLimit import okhttp3.OkHttpClient import java.text.SimpleDateFormat import java.util.Locale @@ -15,7 +15,7 @@ class SmashScan : Madara( ) { override val client: OkHttpClient = super.client.newBuilder() - .addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) + .rateLimit(1, 2, TimeUnit.SECONDS) .build() override val altName = "Nome alternativo: " diff --git a/multisrc/overrides/madara/sodascan/src/SodaScan.kt b/multisrc/overrides/madara/sodascan/src/SodaScan.kt index 2d10ad8f7..ea6fc3297 100644 --- a/multisrc/overrides/madara/sodascan/src/SodaScan.kt +++ b/multisrc/overrides/madara/sodascan/src/SodaScan.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.pt.sodascan -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.madara.Madara +import eu.kanade.tachiyomi.network.interceptor.rateLimit import okhttp3.OkHttpClient import java.text.SimpleDateFormat import java.util.Locale @@ -15,6 +15,6 @@ class SodaScan : Madara( ) { override val client: OkHttpClient = super.client.newBuilder() - .addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) + .rateLimit(1, 2, TimeUnit.SECONDS) .build() } diff --git a/multisrc/overrides/madara/sweettimescan/src/SweetTimeScan.kt b/multisrc/overrides/madara/sweettimescan/src/SweetTimeScan.kt index 2e8c43bbc..48bcb2a70 100644 --- a/multisrc/overrides/madara/sweettimescan/src/SweetTimeScan.kt +++ b/multisrc/overrides/madara/sweettimescan/src/SweetTimeScan.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.pt.sweettimescan -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.madara.Madara +import eu.kanade.tachiyomi.network.interceptor.rateLimit import eu.kanade.tachiyomi.source.model.MangasPage import okhttp3.OkHttpClient import okhttp3.Response @@ -18,7 +18,7 @@ class SweetTimeScan : Madara( ) { override val client: OkHttpClient = super.client.newBuilder() - .addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) + .rateLimit(1, 2, TimeUnit.SECONDS) .build() // The source has novels in text format, so we need to filter them. diff --git a/multisrc/overrides/madara/tatakaescan/src/TatakaeScan.kt b/multisrc/overrides/madara/tatakaescan/src/TatakaeScan.kt index a1cc7b19e..ce21417ba 100644 --- a/multisrc/overrides/madara/tatakaescan/src/TatakaeScan.kt +++ b/multisrc/overrides/madara/tatakaescan/src/TatakaeScan.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.pt.tatakaescan -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.madara.Madara +import eu.kanade.tachiyomi.network.interceptor.rateLimit import okhttp3.OkHttpClient import java.text.SimpleDateFormat import java.util.Locale @@ -15,6 +15,6 @@ class TatakaeScan : Madara( ) { override val client: OkHttpClient = super.client.newBuilder() - .addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) + .rateLimit(1, 2, TimeUnit.SECONDS) .build() } diff --git a/multisrc/overrides/madara/thesugar/src/TheSugar.kt b/multisrc/overrides/madara/thesugar/src/TheSugar.kt index 35cf624cb..798df7f3d 100644 --- a/multisrc/overrides/madara/thesugar/src/TheSugar.kt +++ b/multisrc/overrides/madara/thesugar/src/TheSugar.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.pt.thesugar -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.madara.Madara +import eu.kanade.tachiyomi.network.interceptor.rateLimit import okhttp3.OkHttpClient import java.text.SimpleDateFormat import java.util.Locale @@ -15,7 +15,7 @@ class TheSugar : Madara( ) { override val client: OkHttpClient = super.client.newBuilder() - .addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) + .rateLimit(1, 2, TimeUnit.SECONDS) .build() override val useNewChapterEndpoint = true diff --git a/multisrc/overrides/madara/threequeensscanlator/src/ThreeQueensScanlator.kt b/multisrc/overrides/madara/threequeensscanlator/src/ThreeQueensScanlator.kt index a7dc29b12..d44a68dcf 100644 --- a/multisrc/overrides/madara/threequeensscanlator/src/ThreeQueensScanlator.kt +++ b/multisrc/overrides/madara/threequeensscanlator/src/ThreeQueensScanlator.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.pt.threequeensscanlator -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.madara.Madara +import eu.kanade.tachiyomi.network.interceptor.rateLimit import okhttp3.OkHttpClient import java.text.SimpleDateFormat import java.util.Locale @@ -15,6 +15,6 @@ class ThreeQueensScanlator : Madara( ) { override val client: OkHttpClient = super.client.newBuilder() - .addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) + .rateLimit(1, 2, TimeUnit.SECONDS) .build() } diff --git a/multisrc/overrides/madara/vapohentai/src/VapoHentai.kt b/multisrc/overrides/madara/vapohentai/src/VapoHentai.kt index 85458915e..577c04ce1 100644 --- a/multisrc/overrides/madara/vapohentai/src/VapoHentai.kt +++ b/multisrc/overrides/madara/vapohentai/src/VapoHentai.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.pt.vapohentai -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.madara.Madara +import eu.kanade.tachiyomi.network.interceptor.rateLimit import okhttp3.OkHttpClient import java.text.SimpleDateFormat import java.util.Locale @@ -15,6 +15,6 @@ class VapoHentai : Madara( ) { override val client: OkHttpClient = super.client.newBuilder() - .addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) + .rateLimit(1, 2, TimeUnit.SECONDS) .build() } diff --git a/multisrc/overrides/madara/vaposcan/src/VapoScan.kt b/multisrc/overrides/madara/vaposcan/src/VapoScan.kt index f387cfe16..214c465aa 100644 --- a/multisrc/overrides/madara/vaposcan/src/VapoScan.kt +++ b/multisrc/overrides/madara/vaposcan/src/VapoScan.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.pt.vaposcan -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.madara.Madara +import eu.kanade.tachiyomi.network.interceptor.rateLimit import okhttp3.OkHttpClient import java.text.SimpleDateFormat import java.util.Locale @@ -18,7 +18,7 @@ class VapoScan : Madara( override val versionId = 2 override val client: OkHttpClient = super.client.newBuilder() - .addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) + .rateLimit(1, 2, TimeUnit.SECONDS) .build() override val useNewChapterEndpoint = true diff --git a/multisrc/overrides/madara/visbellum/src/Visbellum.kt b/multisrc/overrides/madara/visbellum/src/Visbellum.kt index 67dcafe59..bd9eb5913 100644 --- a/multisrc/overrides/madara/visbellum/src/Visbellum.kt +++ b/multisrc/overrides/madara/visbellum/src/Visbellum.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.pt.visbellum -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.madara.Madara +import eu.kanade.tachiyomi.network.interceptor.rateLimit import okhttp3.OkHttpClient import java.text.SimpleDateFormat import java.util.Locale @@ -15,6 +15,6 @@ class Visbellum : Madara( ) { override val client: OkHttpClient = super.client.newBuilder() - .addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) + .rateLimit(1, 2, TimeUnit.SECONDS) .build() } diff --git a/multisrc/overrides/madara/warqueenscan/src/WarQueenScan.kt b/multisrc/overrides/madara/warqueenscan/src/WarQueenScan.kt index 304f1ae8b..5c7ed8b57 100644 --- a/multisrc/overrides/madara/warqueenscan/src/WarQueenScan.kt +++ b/multisrc/overrides/madara/warqueenscan/src/WarQueenScan.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.pt.warqueenscan -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.madara.Madara +import eu.kanade.tachiyomi.network.interceptor.rateLimit import okhttp3.OkHttpClient import java.text.SimpleDateFormat import java.util.Locale @@ -15,7 +15,7 @@ class WarQueenScan : Madara( ) { override val client: OkHttpClient = super.client.newBuilder() - .addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) + .rateLimit(1, 2, TimeUnit.SECONDS) .connectTimeout(1, TimeUnit.MINUTES) .readTimeout(1, TimeUnit.MINUTES) .writeTimeout(1, TimeUnit.MINUTES) diff --git a/multisrc/overrides/madara/winterscan/src/WinterScan.kt b/multisrc/overrides/madara/winterscan/src/WinterScan.kt index 83f1fbc26..4675b1bab 100644 --- a/multisrc/overrides/madara/winterscan/src/WinterScan.kt +++ b/multisrc/overrides/madara/winterscan/src/WinterScan.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.pt.winterscan -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.madara.Madara +import eu.kanade.tachiyomi.network.interceptor.rateLimit import okhttp3.OkHttpClient import java.text.SimpleDateFormat import java.util.Locale @@ -15,6 +15,6 @@ class WinterScan : Madara( ) { override val client: OkHttpClient = super.client.newBuilder() - .addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) + .rateLimit(1, 2, TimeUnit.SECONDS) .build() } diff --git a/multisrc/overrides/madara/yaoimanga/src/YaoiManga.kt b/multisrc/overrides/madara/yaoimanga/src/YaoiManga.kt index 2e4933c8e..c9081c185 100644 --- a/multisrc/overrides/madara/yaoimanga/src/YaoiManga.kt +++ b/multisrc/overrides/madara/yaoimanga/src/YaoiManga.kt @@ -1,13 +1,13 @@ package eu.kanade.tachiyomi.extension.en.yaoimanga -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.madara.Madara +import eu.kanade.tachiyomi.network.interceptor.rateLimit import okhttp3.OkHttpClient import java.util.concurrent.TimeUnit class YaoiManga : Madara("Yaoi.mobi", "https://yaoi.mobi", "en") { override val client: OkHttpClient = super.client.newBuilder() - .addInterceptor(RateLimitInterceptor(1, 1, TimeUnit.SECONDS)) + .rateLimit(1, 1, TimeUnit.SECONDS) .build() } diff --git a/multisrc/overrides/madara/yaoitoshokan/src/YaoiToshokan.kt b/multisrc/overrides/madara/yaoitoshokan/src/YaoiToshokan.kt index 3ef84bc3a..5349ed009 100644 --- a/multisrc/overrides/madara/yaoitoshokan/src/YaoiToshokan.kt +++ b/multisrc/overrides/madara/yaoitoshokan/src/YaoiToshokan.kt @@ -1,8 +1,8 @@ package eu.kanade.tachiyomi.extension.pt.yaoitoshokan -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.madara.Madara import eu.kanade.tachiyomi.network.GET +import eu.kanade.tachiyomi.network.interceptor.rateLimit import eu.kanade.tachiyomi.source.model.Page import okhttp3.Headers import okhttp3.OkHttpClient @@ -23,7 +23,7 @@ class YaoiToshokan : Madara( .removeAll("User-Agent") override val client: OkHttpClient = network.client.newBuilder() - .addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) + .rateLimit(1, 2, TimeUnit.SECONDS) .build() // Page has custom link to scan website. diff --git a/multisrc/overrides/madara/yugenmangas/src/YugenMangasFactory.kt b/multisrc/overrides/madara/yugenmangas/src/YugenMangasFactory.kt index cd56d26a1..c37e04cdf 100644 --- a/multisrc/overrides/madara/yugenmangas/src/YugenMangasFactory.kt +++ b/multisrc/overrides/madara/yugenmangas/src/YugenMangasFactory.kt @@ -1,8 +1,8 @@ package eu.kanade.tachiyomi.extension.all.yugenmangas -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.madara.Madara import eu.kanade.tachiyomi.network.GET +import eu.kanade.tachiyomi.network.interceptor.rateLimit import eu.kanade.tachiyomi.source.SourceFactory import eu.kanade.tachiyomi.source.model.SChapter import eu.kanade.tachiyomi.util.asJsoup @@ -50,7 +50,7 @@ class YugenMangasBr : YugenMangas( override val client: OkHttpClient = super.client.newBuilder() .addInterceptor(::uaIntercept) - .addInterceptor(RateLimitInterceptor(1, 3, TimeUnit.SECONDS)) + .rateLimit(1, 3, TimeUnit.SECONDS) .build() override fun headersBuilder(): Headers.Builder = Headers.Builder() diff --git a/multisrc/overrides/madara/yuriverso/src/YuriVerso.kt b/multisrc/overrides/madara/yuriverso/src/YuriVerso.kt index 69a88b9da..8bbda1659 100644 --- a/multisrc/overrides/madara/yuriverso/src/YuriVerso.kt +++ b/multisrc/overrides/madara/yuriverso/src/YuriVerso.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.pt.yuriverso -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.madara.Madara +import eu.kanade.tachiyomi.network.interceptor.rateLimit import okhttp3.OkHttpClient import java.text.SimpleDateFormat import java.util.Locale @@ -15,6 +15,6 @@ class YuriVerso : Madara( ) { override val client: OkHttpClient = super.client.newBuilder() - .addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) + .rateLimit(1, 2, TimeUnit.SECONDS) .build() } diff --git a/multisrc/overrides/madara/zombielandsagascans/src/ZombieLandSagaScans.kt b/multisrc/overrides/madara/zombielandsagascans/src/ZombieLandSagaScans.kt index 7e6b28817..addad8af3 100644 --- a/multisrc/overrides/madara/zombielandsagascans/src/ZombieLandSagaScans.kt +++ b/multisrc/overrides/madara/zombielandsagascans/src/ZombieLandSagaScans.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.pt.zombielandsagascans -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.madara.Madara +import eu.kanade.tachiyomi.network.interceptor.rateLimit import okhttp3.OkHttpClient import java.text.SimpleDateFormat import java.util.Locale @@ -15,6 +15,6 @@ class ZombieLandSagaScans : Madara( ) { override val client: OkHttpClient = super.client.newBuilder() - .addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) + .rateLimit(1, 2, TimeUnit.SECONDS) .build() } diff --git a/multisrc/overrides/madtheme/beehentai/src/BeeHentai.kt b/multisrc/overrides/madtheme/beehentai/src/BeeHentai.kt index 04125eaf0..7b8f9cbd2 100644 --- a/multisrc/overrides/madtheme/beehentai/src/BeeHentai.kt +++ b/multisrc/overrides/madtheme/beehentai/src/BeeHentai.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.en.beehentai -import eu.kanade.tachiyomi.lib.ratelimit.SpecificHostRateLimitInterceptor import eu.kanade.tachiyomi.multisrc.madtheme.MadTheme +import eu.kanade.tachiyomi.network.interceptor.rateLimitHost import okhttp3.HttpUrl.Companion.toHttpUrl import okhttp3.OkHttpClient import java.util.concurrent.TimeUnit @@ -12,45 +12,35 @@ class BeeHentai : MadTheme( "en" ) { override val client: OkHttpClient = network.cloudflareClient.newBuilder() - .addInterceptor( - SpecificHostRateLimitInterceptor( - "https://s1.mbcdnv1.xyz".toHttpUrl(), - 5, - 1, - TimeUnit.SECONDS - ) + .rateLimitHost( + "https://s1.mbcdnv1.xyz".toHttpUrl(), + 5, + 1, + TimeUnit.SECONDS ) - .addInterceptor( - SpecificHostRateLimitInterceptor( - "https://s1.mbcdnv2.xyz".toHttpUrl(), - 1, - 2, - TimeUnit.SECONDS - ) + .rateLimitHost( + "https://s1.mbcdnv2.xyz".toHttpUrl(), + 1, + 2, + TimeUnit.SECONDS ) - .addInterceptor( - SpecificHostRateLimitInterceptor( - "https://s1.mbcdnv3.xyz".toHttpUrl(), - 1, - 2, - TimeUnit.SECONDS - ) + .rateLimitHost( + "https://s1.mbcdnv3.xyz".toHttpUrl(), + 1, + 2, + TimeUnit.SECONDS ) - .addInterceptor( - SpecificHostRateLimitInterceptor( - "https://s1.mbcdnv4.xyz".toHttpUrl(), - 1, - 2, - TimeUnit.SECONDS - ) + .rateLimitHost( + "https://s1.mbcdnv4.xyz".toHttpUrl(), + 1, + 2, + TimeUnit.SECONDS ) - .addInterceptor( - SpecificHostRateLimitInterceptor( - "https://s1.mbcdnv5.xyz".toHttpUrl(), - 1, - 2, - TimeUnit.SECONDS - ) + .rateLimitHost( + "https://s1.mbcdnv5.xyz".toHttpUrl(), + 1, + 2, + TimeUnit.SECONDS ) .build() } diff --git a/multisrc/overrides/madtheme/boxmanhwa/src/BoxManhwa.kt b/multisrc/overrides/madtheme/boxmanhwa/src/BoxManhwa.kt index 7d9a1b8f0..8a71b3670 100644 --- a/multisrc/overrides/madtheme/boxmanhwa/src/BoxManhwa.kt +++ b/multisrc/overrides/madtheme/boxmanhwa/src/BoxManhwa.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.en.boxmanhwa -import eu.kanade.tachiyomi.lib.ratelimit.SpecificHostRateLimitInterceptor import eu.kanade.tachiyomi.multisrc.madtheme.MadTheme +import eu.kanade.tachiyomi.network.interceptor.rateLimitHost import okhttp3.HttpUrl.Companion.toHttpUrl import okhttp3.OkHttpClient import java.util.concurrent.TimeUnit @@ -12,45 +12,35 @@ class BoxManhwa : MadTheme( "en" ) { override val client: OkHttpClient = network.cloudflareClient.newBuilder() - .addInterceptor( - SpecificHostRateLimitInterceptor( - "https://s1.mbcdnv1.xyz".toHttpUrl(), - 5, - 1, - TimeUnit.SECONDS - ) + .rateLimitHost( + "https://s1.mbcdnv1.xyz".toHttpUrl(), + 5, + 1, + TimeUnit.SECONDS ) - .addInterceptor( - SpecificHostRateLimitInterceptor( - "https://s1.mbcdnv2.xyz".toHttpUrl(), - 1, - 2, - TimeUnit.SECONDS - ) + .rateLimitHost( + "https://s1.mbcdnv2.xyz".toHttpUrl(), + 1, + 2, + TimeUnit.SECONDS ) - .addInterceptor( - SpecificHostRateLimitInterceptor( - "https://s1.mbcdnv3.xyz".toHttpUrl(), - 1, - 2, - TimeUnit.SECONDS - ) + .rateLimitHost( + "https://s1.mbcdnv3.xyz".toHttpUrl(), + 1, + 2, + TimeUnit.SECONDS ) - .addInterceptor( - SpecificHostRateLimitInterceptor( - "https://s1.mbcdnv4.xyz".toHttpUrl(), - 1, - 2, - TimeUnit.SECONDS - ) + .rateLimitHost( + "https://s1.mbcdnv4.xyz".toHttpUrl(), + 1, + 2, + TimeUnit.SECONDS ) - .addInterceptor( - SpecificHostRateLimitInterceptor( - "https://s1.mbcdnv5.xyz".toHttpUrl(), - 1, - 2, - TimeUnit.SECONDS - ) + .rateLimitHost( + "https://s1.mbcdnv5.xyz".toHttpUrl(), + 1, + 2, + TimeUnit.SECONDS ) .build() } diff --git a/multisrc/overrides/madtheme/default/additional.gradle.kts b/multisrc/overrides/madtheme/default/additional.gradle.kts deleted file mode 100644 index 10beb8157..000000000 --- a/multisrc/overrides/madtheme/default/additional.gradle.kts +++ /dev/null @@ -1,4 +0,0 @@ - -dependencies { - implementation project(':lib-ratelimit') -} diff --git a/multisrc/overrides/madtheme/mangabuddy/src/MangaBuddy.kt b/multisrc/overrides/madtheme/mangabuddy/src/MangaBuddy.kt index fd41650ab..ffdd2d365 100644 --- a/multisrc/overrides/madtheme/mangabuddy/src/MangaBuddy.kt +++ b/multisrc/overrides/madtheme/mangabuddy/src/MangaBuddy.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.en.mangabuddy -import eu.kanade.tachiyomi.lib.ratelimit.SpecificHostRateLimitInterceptor import eu.kanade.tachiyomi.multisrc.madtheme.MadTheme +import eu.kanade.tachiyomi.network.interceptor.rateLimitHost import okhttp3.HttpUrl.Companion.toHttpUrl import okhttp3.OkHttpClient import java.util.concurrent.TimeUnit @@ -12,45 +12,35 @@ class MangaBuddy : MadTheme( "en" ) { override val client: OkHttpClient = network.cloudflareClient.newBuilder() - .addInterceptor( - SpecificHostRateLimitInterceptor( - "https://s1.mbcdnv1.xyz".toHttpUrl(), - 5, - 1, - TimeUnit.SECONDS - ) + .rateLimitHost( + "https://s1.mbcdnv1.xyz".toHttpUrl(), + 5, + 1, + TimeUnit.SECONDS ) - .addInterceptor( - SpecificHostRateLimitInterceptor( - "https://s1.mbcdnv2.xyz".toHttpUrl(), - 1, - 2, - TimeUnit.SECONDS - ) + .rateLimitHost( + "https://s1.mbcdnv2.xyz".toHttpUrl(), + 1, + 2, + TimeUnit.SECONDS ) - .addInterceptor( - SpecificHostRateLimitInterceptor( - "https://s1.mbcdnv3.xyz".toHttpUrl(), - 1, - 2, - TimeUnit.SECONDS - ) + .rateLimitHost( + "https://s1.mbcdnv3.xyz".toHttpUrl(), + 1, + 2, + TimeUnit.SECONDS ) - .addInterceptor( - SpecificHostRateLimitInterceptor( - "https://s1.mbcdnv4.xyz".toHttpUrl(), - 1, - 2, - TimeUnit.SECONDS - ) + .rateLimitHost( + "https://s1.mbcdnv4.xyz".toHttpUrl(), + 1, + 2, + TimeUnit.SECONDS ) - .addInterceptor( - SpecificHostRateLimitInterceptor( - "https://s1.mbcdnv5.xyz".toHttpUrl(), - 1, - 2, - TimeUnit.SECONDS - ) + .rateLimitHost( + "https://s1.mbcdnv5.xyz".toHttpUrl(), + 1, + 2, + TimeUnit.SECONDS ) .build() } diff --git a/multisrc/overrides/madtheme/mangacute/src/MangaCute.kt b/multisrc/overrides/madtheme/mangacute/src/MangaCute.kt index 0ed8b4e6f..dd6a92274 100644 --- a/multisrc/overrides/madtheme/mangacute/src/MangaCute.kt +++ b/multisrc/overrides/madtheme/mangacute/src/MangaCute.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.en.mangacute -import eu.kanade.tachiyomi.lib.ratelimit.SpecificHostRateLimitInterceptor import eu.kanade.tachiyomi.multisrc.madtheme.MadTheme +import eu.kanade.tachiyomi.network.interceptor.rateLimitHost import okhttp3.HttpUrl.Companion.toHttpUrl import okhttp3.OkHttpClient import java.util.concurrent.TimeUnit @@ -12,45 +12,35 @@ class MangaCute : MadTheme( "en" ) { override val client: OkHttpClient = network.cloudflareClient.newBuilder() - .addInterceptor( - SpecificHostRateLimitInterceptor( - "https://s1.mbcdnv1.xyz".toHttpUrl(), - 5, - 1, - TimeUnit.SECONDS - ) + .rateLimitHost( + "https://s1.mbcdnv1.xyz".toHttpUrl(), + 5, + 1, + TimeUnit.SECONDS ) - .addInterceptor( - SpecificHostRateLimitInterceptor( - "https://s1.mbcdnv2.xyz".toHttpUrl(), - 1, - 2, - TimeUnit.SECONDS - ) + .rateLimitHost( + "https://s1.mbcdnv2.xyz".toHttpUrl(), + 1, + 2, + TimeUnit.SECONDS ) - .addInterceptor( - SpecificHostRateLimitInterceptor( - "https://s1.mbcdnv3.xyz".toHttpUrl(), - 1, - 2, - TimeUnit.SECONDS - ) + .rateLimitHost( + "https://s1.mbcdnv3.xyz".toHttpUrl(), + 1, + 2, + TimeUnit.SECONDS ) - .addInterceptor( - SpecificHostRateLimitInterceptor( - "https://s1.mbcdnv4.xyz".toHttpUrl(), - 1, - 2, - TimeUnit.SECONDS - ) + .rateLimitHost( + "https://s1.mbcdnv4.xyz".toHttpUrl(), + 1, + 2, + TimeUnit.SECONDS ) - .addInterceptor( - SpecificHostRateLimitInterceptor( - "https://s1.mbcdnv5.xyz".toHttpUrl(), - 1, - 2, - TimeUnit.SECONDS - ) + .rateLimitHost( + "https://s1.mbcdnv5.xyz".toHttpUrl(), + 1, + 2, + TimeUnit.SECONDS ) .build() } diff --git a/multisrc/overrides/madtheme/mangafab/src/MangaFab.kt b/multisrc/overrides/madtheme/mangafab/src/MangaFab.kt index ccb355767..efc1246c5 100644 --- a/multisrc/overrides/madtheme/mangafab/src/MangaFab.kt +++ b/multisrc/overrides/madtheme/mangafab/src/MangaFab.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.en.mangafab -import eu.kanade.tachiyomi.lib.ratelimit.SpecificHostRateLimitInterceptor import eu.kanade.tachiyomi.multisrc.madtheme.MadTheme +import eu.kanade.tachiyomi.network.interceptor.rateLimitHost import okhttp3.HttpUrl.Companion.toHttpUrl import okhttp3.OkHttpClient import java.util.concurrent.TimeUnit @@ -12,45 +12,35 @@ class MangaFab : MadTheme( "en" ) { override val client: OkHttpClient = network.cloudflareClient.newBuilder() - .addInterceptor( - SpecificHostRateLimitInterceptor( - "https://s1.mbcdnv1.xyz".toHttpUrl(), - 5, - 1, - TimeUnit.SECONDS - ) + .rateLimitHost( + "https://s1.mbcdnv1.xyz".toHttpUrl(), + 5, + 1, + TimeUnit.SECONDS ) - .addInterceptor( - SpecificHostRateLimitInterceptor( - "https://s1.mbcdnv2.xyz".toHttpUrl(), - 1, - 2, - TimeUnit.SECONDS - ) + .rateLimitHost( + "https://s1.mbcdnv2.xyz".toHttpUrl(), + 1, + 2, + TimeUnit.SECONDS ) - .addInterceptor( - SpecificHostRateLimitInterceptor( - "https://s1.mbcdnv3.xyz".toHttpUrl(), - 1, - 2, - TimeUnit.SECONDS - ) + .rateLimitHost( + "https://s1.mbcdnv3.xyz".toHttpUrl(), + 1, + 2, + TimeUnit.SECONDS ) - .addInterceptor( - SpecificHostRateLimitInterceptor( - "https://s1.mbcdnv4.xyz".toHttpUrl(), - 1, - 2, - TimeUnit.SECONDS - ) + .rateLimitHost( + "https://s1.mbcdnv4.xyz".toHttpUrl(), + 1, + 2, + TimeUnit.SECONDS ) - .addInterceptor( - SpecificHostRateLimitInterceptor( - "https://s1.mbcdnv5.xyz".toHttpUrl(), - 1, - 2, - TimeUnit.SECONDS - ) + .rateLimitHost( + "https://s1.mbcdnv5.xyz".toHttpUrl(), + 1, + 2, + TimeUnit.SECONDS ) .build() } diff --git a/multisrc/overrides/madtheme/mangaforest/src/MangaForest.kt b/multisrc/overrides/madtheme/mangaforest/src/MangaForest.kt index 376543958..3bcf8de68 100644 --- a/multisrc/overrides/madtheme/mangaforest/src/MangaForest.kt +++ b/multisrc/overrides/madtheme/mangaforest/src/MangaForest.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.en.mangaforest -import eu.kanade.tachiyomi.lib.ratelimit.SpecificHostRateLimitInterceptor import eu.kanade.tachiyomi.multisrc.madtheme.MadTheme +import eu.kanade.tachiyomi.network.interceptor.rateLimitHost import okhttp3.HttpUrl.Companion.toHttpUrl import okhttp3.OkHttpClient import java.util.concurrent.TimeUnit @@ -12,45 +12,35 @@ class MangaForest : MadTheme( "en" ) { override val client: OkHttpClient = network.cloudflareClient.newBuilder() - .addInterceptor( - SpecificHostRateLimitInterceptor( - "https://s1.mbcdnv1.xyz".toHttpUrl(), - 5, - 1, - TimeUnit.SECONDS - ) + .rateLimitHost( + "https://s1.mbcdnv1.xyz".toHttpUrl(), + 5, + 1, + TimeUnit.SECONDS ) - .addInterceptor( - SpecificHostRateLimitInterceptor( - "https://s1.mbcdnv2.xyz".toHttpUrl(), - 1, - 2, - TimeUnit.SECONDS - ) + .rateLimitHost( + "https://s1.mbcdnv2.xyz".toHttpUrl(), + 1, + 2, + TimeUnit.SECONDS ) - .addInterceptor( - SpecificHostRateLimitInterceptor( - "https://s1.mbcdnv3.xyz".toHttpUrl(), - 1, - 2, - TimeUnit.SECONDS - ) + .rateLimitHost( + "https://s1.mbcdnv3.xyz".toHttpUrl(), + 1, + 2, + TimeUnit.SECONDS ) - .addInterceptor( - SpecificHostRateLimitInterceptor( - "https://s1.mbcdnv4.xyz".toHttpUrl(), - 1, - 2, - TimeUnit.SECONDS - ) + .rateLimitHost( + "https://s1.mbcdnv4.xyz".toHttpUrl(), + 1, + 2, + TimeUnit.SECONDS ) - .addInterceptor( - SpecificHostRateLimitInterceptor( - "https://s1.mbcdnv5.xyz".toHttpUrl(), - 1, - 2, - TimeUnit.SECONDS - ) + .rateLimitHost( + "https://s1.mbcdnv5.xyz".toHttpUrl(), + 1, + 2, + TimeUnit.SECONDS ) .build() } diff --git a/multisrc/overrides/madtheme/mangamad/src/MangaMad.kt b/multisrc/overrides/madtheme/mangamad/src/MangaMad.kt index 9558ee43e..bd0aafea9 100644 --- a/multisrc/overrides/madtheme/mangamad/src/MangaMad.kt +++ b/multisrc/overrides/madtheme/mangamad/src/MangaMad.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.en.mangamad -import eu.kanade.tachiyomi.lib.ratelimit.SpecificHostRateLimitInterceptor import eu.kanade.tachiyomi.multisrc.madtheme.MadTheme +import eu.kanade.tachiyomi.network.interceptor.rateLimitHost import okhttp3.HttpUrl.Companion.toHttpUrl import okhttp3.OkHttpClient import java.util.concurrent.TimeUnit @@ -12,45 +12,35 @@ class MangaMad : MadTheme( "en" ) { override val client: OkHttpClient = network.cloudflareClient.newBuilder() - .addInterceptor( - SpecificHostRateLimitInterceptor( - "https://s1.mbcdnv1.xyz".toHttpUrl(), - 5, - 1, - TimeUnit.SECONDS - ) + .rateLimitHost( + "https://s1.mbcdnv1.xyz".toHttpUrl(), + 5, + 1, + TimeUnit.SECONDS ) - .addInterceptor( - SpecificHostRateLimitInterceptor( - "https://s1.mbcdnv2.xyz".toHttpUrl(), - 1, - 2, - TimeUnit.SECONDS - ) + .rateLimitHost( + "https://s1.mbcdnv2.xyz".toHttpUrl(), + 1, + 2, + TimeUnit.SECONDS ) - .addInterceptor( - SpecificHostRateLimitInterceptor( - "https://s1.mbcdnv3.xyz".toHttpUrl(), - 1, - 2, - TimeUnit.SECONDS - ) + .rateLimitHost( + "https://s1.mbcdnv3.xyz".toHttpUrl(), + 1, + 2, + TimeUnit.SECONDS ) - .addInterceptor( - SpecificHostRateLimitInterceptor( - "https://s1.mbcdnv4.xyz".toHttpUrl(), - 1, - 2, - TimeUnit.SECONDS - ) + .rateLimitHost( + "https://s1.mbcdnv4.xyz".toHttpUrl(), + 1, + 2, + TimeUnit.SECONDS ) - .addInterceptor( - SpecificHostRateLimitInterceptor( - "https://s1.mbcdnv5.xyz".toHttpUrl(), - 1, - 2, - TimeUnit.SECONDS - ) + .rateLimitHost( + "https://s1.mbcdnv5.xyz".toHttpUrl(), + 1, + 2, + TimeUnit.SECONDS ) .build() } diff --git a/multisrc/overrides/madtheme/mangamax/src/MangaMax.kt b/multisrc/overrides/madtheme/mangamax/src/MangaMax.kt index aa8ee411a..8efb7f1c3 100644 --- a/multisrc/overrides/madtheme/mangamax/src/MangaMax.kt +++ b/multisrc/overrides/madtheme/mangamax/src/MangaMax.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.en.mangamax -import eu.kanade.tachiyomi.lib.ratelimit.SpecificHostRateLimitInterceptor import eu.kanade.tachiyomi.multisrc.madtheme.MadTheme +import eu.kanade.tachiyomi.network.interceptor.rateLimitHost import okhttp3.HttpUrl.Companion.toHttpUrl import okhttp3.OkHttpClient import java.util.concurrent.TimeUnit @@ -12,45 +12,35 @@ class MangaMax : MadTheme( "en" ) { override val client: OkHttpClient = network.cloudflareClient.newBuilder() - .addInterceptor( - SpecificHostRateLimitInterceptor( - "https://s1.mbcdnv1.xyz".toHttpUrl(), - 5, - 1, - TimeUnit.SECONDS - ) + .rateLimitHost( + "https://s1.mbcdnv1.xyz".toHttpUrl(), + 5, + 1, + TimeUnit.SECONDS ) - .addInterceptor( - SpecificHostRateLimitInterceptor( - "https://s1.mbcdnv2.xyz".toHttpUrl(), - 1, - 2, - TimeUnit.SECONDS - ) + .rateLimitHost( + "https://s1.mbcdnv2.xyz".toHttpUrl(), + 1, + 2, + TimeUnit.SECONDS ) - .addInterceptor( - SpecificHostRateLimitInterceptor( - "https://s1.mbcdnv3.xyz".toHttpUrl(), - 1, - 2, - TimeUnit.SECONDS - ) + .rateLimitHost( + "https://s1.mbcdnv3.xyz".toHttpUrl(), + 1, + 2, + TimeUnit.SECONDS ) - .addInterceptor( - SpecificHostRateLimitInterceptor( - "https://s1.mbcdnv4.xyz".toHttpUrl(), - 1, - 2, - TimeUnit.SECONDS - ) + .rateLimitHost( + "https://s1.mbcdnv4.xyz".toHttpUrl(), + 1, + 2, + TimeUnit.SECONDS ) - .addInterceptor( - SpecificHostRateLimitInterceptor( - "https://s1.mbcdnv5.xyz".toHttpUrl(), - 1, - 2, - TimeUnit.SECONDS - ) + .rateLimitHost( + "https://s1.mbcdnv5.xyz".toHttpUrl(), + 1, + 2, + TimeUnit.SECONDS ) .build() } diff --git a/multisrc/overrides/madtheme/mangasaga/src/MangaSaga.kt b/multisrc/overrides/madtheme/mangasaga/src/MangaSaga.kt index 53321f934..8d429e785 100644 --- a/multisrc/overrides/madtheme/mangasaga/src/MangaSaga.kt +++ b/multisrc/overrides/madtheme/mangasaga/src/MangaSaga.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.en.mangasaga -import eu.kanade.tachiyomi.lib.ratelimit.SpecificHostRateLimitInterceptor import eu.kanade.tachiyomi.multisrc.madtheme.MadTheme +import eu.kanade.tachiyomi.network.interceptor.rateLimitHost import okhttp3.HttpUrl.Companion.toHttpUrl import okhttp3.OkHttpClient import java.util.concurrent.TimeUnit @@ -12,45 +12,35 @@ class MangaSaga : MadTheme( "en" ) { override val client: OkHttpClient = network.cloudflareClient.newBuilder() - .addInterceptor( - SpecificHostRateLimitInterceptor( - "https://s1.mbcdnv1.xyz".toHttpUrl(), - 5, - 1, - TimeUnit.SECONDS - ) + .rateLimitHost( + "https://s1.mbcdnv1.xyz".toHttpUrl(), + 5, + 1, + TimeUnit.SECONDS ) - .addInterceptor( - SpecificHostRateLimitInterceptor( - "https://s1.mbcdnv2.xyz".toHttpUrl(), - 1, - 2, - TimeUnit.SECONDS - ) + .rateLimitHost( + "https://s1.mbcdnv2.xyz".toHttpUrl(), + 1, + 2, + TimeUnit.SECONDS ) - .addInterceptor( - SpecificHostRateLimitInterceptor( - "https://s1.mbcdnv3.xyz".toHttpUrl(), - 1, - 2, - TimeUnit.SECONDS - ) + .rateLimitHost( + "https://s1.mbcdnv3.xyz".toHttpUrl(), + 1, + 2, + TimeUnit.SECONDS ) - .addInterceptor( - SpecificHostRateLimitInterceptor( - "https://s1.mbcdnv4.xyz".toHttpUrl(), - 1, - 2, - TimeUnit.SECONDS - ) + .rateLimitHost( + "https://s1.mbcdnv4.xyz".toHttpUrl(), + 1, + 2, + TimeUnit.SECONDS ) - .addInterceptor( - SpecificHostRateLimitInterceptor( - "https://s1.mbcdnv5.xyz".toHttpUrl(), - 1, - 2, - TimeUnit.SECONDS - ) + .rateLimitHost( + "https://s1.mbcdnv5.xyz".toHttpUrl(), + 1, + 2, + TimeUnit.SECONDS ) .build() } diff --git a/multisrc/overrides/madtheme/mangaspin/src/MangaSpin.kt b/multisrc/overrides/madtheme/mangaspin/src/MangaSpin.kt index 9f3ef583c..87dd77011 100644 --- a/multisrc/overrides/madtheme/mangaspin/src/MangaSpin.kt +++ b/multisrc/overrides/madtheme/mangaspin/src/MangaSpin.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.en.mangaspin -import eu.kanade.tachiyomi.lib.ratelimit.SpecificHostRateLimitInterceptor import eu.kanade.tachiyomi.multisrc.madtheme.MadTheme +import eu.kanade.tachiyomi.network.interceptor.rateLimitHost import okhttp3.HttpUrl.Companion.toHttpUrl import okhttp3.OkHttpClient import java.util.concurrent.TimeUnit @@ -12,45 +12,35 @@ class MangaSpin : MadTheme( "en" ) { override val client: OkHttpClient = network.cloudflareClient.newBuilder() - .addInterceptor( - SpecificHostRateLimitInterceptor( - "https://s1.mbcdnv1.xyz".toHttpUrl(), - 5, - 1, - TimeUnit.SECONDS - ) + .rateLimitHost( + "https://s1.mbcdnv1.xyz".toHttpUrl(), + 5, + 1, + TimeUnit.SECONDS ) - .addInterceptor( - SpecificHostRateLimitInterceptor( - "https://s1.mbcdnv2.xyz".toHttpUrl(), - 1, - 2, - TimeUnit.SECONDS - ) + .rateLimitHost( + "https://s1.mbcdnv2.xyz".toHttpUrl(), + 1, + 2, + TimeUnit.SECONDS ) - .addInterceptor( - SpecificHostRateLimitInterceptor( - "https://s1.mbcdnv3.xyz".toHttpUrl(), - 1, - 2, - TimeUnit.SECONDS - ) + .rateLimitHost( + "https://s1.mbcdnv3.xyz".toHttpUrl(), + 1, + 2, + TimeUnit.SECONDS ) - .addInterceptor( - SpecificHostRateLimitInterceptor( - "https://s1.mbcdnv4.xyz".toHttpUrl(), - 1, - 2, - TimeUnit.SECONDS - ) + .rateLimitHost( + "https://s1.mbcdnv4.xyz".toHttpUrl(), + 1, + 2, + TimeUnit.SECONDS ) - .addInterceptor( - SpecificHostRateLimitInterceptor( - "https://s1.mbcdnv5.xyz".toHttpUrl(), - 1, - 2, - TimeUnit.SECONDS - ) + .rateLimitHost( + "https://s1.mbcdnv5.xyz".toHttpUrl(), + 1, + 2, + TimeUnit.SECONDS ) .build() } diff --git a/multisrc/overrides/madtheme/mangaxyz/src/MangaXYZ.kt b/multisrc/overrides/madtheme/mangaxyz/src/MangaXYZ.kt index 27f210f99..1b4b50bc5 100644 --- a/multisrc/overrides/madtheme/mangaxyz/src/MangaXYZ.kt +++ b/multisrc/overrides/madtheme/mangaxyz/src/MangaXYZ.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.en.mangaxyz -import eu.kanade.tachiyomi.lib.ratelimit.SpecificHostRateLimitInterceptor import eu.kanade.tachiyomi.multisrc.madtheme.MadTheme +import eu.kanade.tachiyomi.network.interceptor.rateLimitHost import okhttp3.HttpUrl.Companion.toHttpUrl import okhttp3.OkHttpClient import java.util.concurrent.TimeUnit @@ -12,45 +12,35 @@ class MangaXYZ : MadTheme( "en" ) { override val client: OkHttpClient = network.cloudflareClient.newBuilder() - .addInterceptor( - SpecificHostRateLimitInterceptor( - "https://s1.mbcdnv1.xyz".toHttpUrl(), - 5, - 1, - TimeUnit.SECONDS - ) + .rateLimitHost( + "https://s1.mbcdnv1.xyz".toHttpUrl(), + 5, + 1, + TimeUnit.SECONDS ) - .addInterceptor( - SpecificHostRateLimitInterceptor( - "https://s1.mbcdnv2.xyz".toHttpUrl(), - 1, - 2, - TimeUnit.SECONDS - ) + .rateLimitHost( + "https://s1.mbcdnv2.xyz".toHttpUrl(), + 1, + 2, + TimeUnit.SECONDS ) - .addInterceptor( - SpecificHostRateLimitInterceptor( - "https://s1.mbcdnv3.xyz".toHttpUrl(), - 1, - 2, - TimeUnit.SECONDS - ) + .rateLimitHost( + "https://s1.mbcdnv3.xyz".toHttpUrl(), + 1, + 2, + TimeUnit.SECONDS ) - .addInterceptor( - SpecificHostRateLimitInterceptor( - "https://s1.mbcdnv4.xyz".toHttpUrl(), - 1, - 2, - TimeUnit.SECONDS - ) + .rateLimitHost( + "https://s1.mbcdnv4.xyz".toHttpUrl(), + 1, + 2, + TimeUnit.SECONDS ) - .addInterceptor( - SpecificHostRateLimitInterceptor( - "https://s1.mbcdnv5.xyz".toHttpUrl(), - 1, - 2, - TimeUnit.SECONDS - ) + .rateLimitHost( + "https://s1.mbcdnv5.xyz".toHttpUrl(), + 1, + 2, + TimeUnit.SECONDS ) .build() } diff --git a/multisrc/overrides/madtheme/manhuanow/src/ManhuaNow.kt b/multisrc/overrides/madtheme/manhuanow/src/ManhuaNow.kt index 9cf6aafa9..7f8a7a99c 100644 --- a/multisrc/overrides/madtheme/manhuanow/src/ManhuaNow.kt +++ b/multisrc/overrides/madtheme/manhuanow/src/ManhuaNow.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.en.manhuanow -import eu.kanade.tachiyomi.lib.ratelimit.SpecificHostRateLimitInterceptor import eu.kanade.tachiyomi.multisrc.madtheme.MadTheme +import eu.kanade.tachiyomi.network.interceptor.rateLimitHost import okhttp3.HttpUrl.Companion.toHttpUrl import okhttp3.OkHttpClient import java.util.concurrent.TimeUnit @@ -12,45 +12,35 @@ class ManhuaNow : MadTheme( "en" ) { override val client: OkHttpClient = network.cloudflareClient.newBuilder() - .addInterceptor( - SpecificHostRateLimitInterceptor( - "https://s1.mbcdnv1.xyz".toHttpUrl(), - 5, - 1, - TimeUnit.SECONDS - ) + .rateLimitHost( + "https://s1.mbcdnv1.xyz".toHttpUrl(), + 5, + 1, + TimeUnit.SECONDS ) - .addInterceptor( - SpecificHostRateLimitInterceptor( - "https://s1.mbcdnv2.xyz".toHttpUrl(), - 1, - 2, - TimeUnit.SECONDS - ) + .rateLimitHost( + "https://s1.mbcdnv2.xyz".toHttpUrl(), + 1, + 2, + TimeUnit.SECONDS ) - .addInterceptor( - SpecificHostRateLimitInterceptor( - "https://s1.mbcdnv3.xyz".toHttpUrl(), - 1, - 2, - TimeUnit.SECONDS - ) + .rateLimitHost( + "https://s1.mbcdnv3.xyz".toHttpUrl(), + 1, + 2, + TimeUnit.SECONDS ) - .addInterceptor( - SpecificHostRateLimitInterceptor( - "https://s1.mbcdnv4.xyz".toHttpUrl(), - 1, - 2, - TimeUnit.SECONDS - ) + .rateLimitHost( + "https://s1.mbcdnv4.xyz".toHttpUrl(), + 1, + 2, + TimeUnit.SECONDS ) - .addInterceptor( - SpecificHostRateLimitInterceptor( - "https://s1.mbcdnv5.xyz".toHttpUrl(), - 1, - 2, - TimeUnit.SECONDS - ) + .rateLimitHost( + "https://s1.mbcdnv5.xyz".toHttpUrl(), + 1, + 2, + TimeUnit.SECONDS ) .build() } diff --git a/multisrc/overrides/madtheme/manhuasite/src/ManhuaSite.kt b/multisrc/overrides/madtheme/manhuasite/src/ManhuaSite.kt index 72e23bb04..7ee69bf72 100644 --- a/multisrc/overrides/madtheme/manhuasite/src/ManhuaSite.kt +++ b/multisrc/overrides/madtheme/manhuasite/src/ManhuaSite.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.en.manhuasite -import eu.kanade.tachiyomi.lib.ratelimit.SpecificHostRateLimitInterceptor import eu.kanade.tachiyomi.multisrc.madtheme.MadTheme +import eu.kanade.tachiyomi.network.interceptor.rateLimitHost import okhttp3.HttpUrl.Companion.toHttpUrl import okhttp3.OkHttpClient import java.util.concurrent.TimeUnit @@ -12,45 +12,35 @@ class ManhuaSite : MadTheme( "en" ) { override val client: OkHttpClient = network.cloudflareClient.newBuilder() - .addInterceptor( - SpecificHostRateLimitInterceptor( - "https://s1.mbcdnv1.xyz".toHttpUrl(), - 5, - 1, - TimeUnit.SECONDS - ) + .rateLimitHost( + "https://s1.mbcdnv1.xyz".toHttpUrl(), + 5, + 1, + TimeUnit.SECONDS ) - .addInterceptor( - SpecificHostRateLimitInterceptor( - "https://s1.mbcdnv2.xyz".toHttpUrl(), - 1, - 2, - TimeUnit.SECONDS - ) + .rateLimitHost( + "https://s1.mbcdnv2.xyz".toHttpUrl(), + 1, + 2, + TimeUnit.SECONDS ) - .addInterceptor( - SpecificHostRateLimitInterceptor( - "https://s1.mbcdnv3.xyz".toHttpUrl(), - 1, - 2, - TimeUnit.SECONDS - ) + .rateLimitHost( + "https://s1.mbcdnv3.xyz".toHttpUrl(), + 1, + 2, + TimeUnit.SECONDS ) - .addInterceptor( - SpecificHostRateLimitInterceptor( - "https://s1.mbcdnv4.xyz".toHttpUrl(), - 1, - 2, - TimeUnit.SECONDS - ) + .rateLimitHost( + "https://s1.mbcdnv4.xyz".toHttpUrl(), + 1, + 2, + TimeUnit.SECONDS ) - .addInterceptor( - SpecificHostRateLimitInterceptor( - "https://s1.mbcdnv5.xyz".toHttpUrl(), - 1, - 2, - TimeUnit.SECONDS - ) + .rateLimitHost( + "https://s1.mbcdnv5.xyz".toHttpUrl(), + 1, + 2, + TimeUnit.SECONDS ) .build() } diff --git a/multisrc/overrides/madtheme/tooniclub/src/TooniClub.kt b/multisrc/overrides/madtheme/tooniclub/src/TooniClub.kt index 250937c6a..2ed755d33 100644 --- a/multisrc/overrides/madtheme/tooniclub/src/TooniClub.kt +++ b/multisrc/overrides/madtheme/tooniclub/src/TooniClub.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.en.tooniclub -import eu.kanade.tachiyomi.lib.ratelimit.SpecificHostRateLimitInterceptor import eu.kanade.tachiyomi.multisrc.madtheme.MadTheme +import eu.kanade.tachiyomi.network.interceptor.rateLimitHost import okhttp3.HttpUrl.Companion.toHttpUrl import okhttp3.OkHttpClient import java.util.concurrent.TimeUnit @@ -12,45 +12,35 @@ class TooniClub : MadTheme( "en" ) { override val client: OkHttpClient = network.cloudflareClient.newBuilder() - .addInterceptor( - SpecificHostRateLimitInterceptor( - "https://s1.mbcdnv1.xyz".toHttpUrl(), - 5, - 1, - TimeUnit.SECONDS - ) + .rateLimitHost( + "https://s1.mbcdnv1.xyz".toHttpUrl(), + 5, + 1, + TimeUnit.SECONDS ) - .addInterceptor( - SpecificHostRateLimitInterceptor( - "https://s1.mbcdnv2.xyz".toHttpUrl(), - 1, - 2, - TimeUnit.SECONDS - ) + .rateLimitHost( + "https://s1.mbcdnv2.xyz".toHttpUrl(), + 1, + 2, + TimeUnit.SECONDS ) - .addInterceptor( - SpecificHostRateLimitInterceptor( - "https://s1.mbcdnv3.xyz".toHttpUrl(), - 1, - 2, - TimeUnit.SECONDS - ) + .rateLimitHost( + "https://s1.mbcdnv3.xyz".toHttpUrl(), + 1, + 2, + TimeUnit.SECONDS ) - .addInterceptor( - SpecificHostRateLimitInterceptor( - "https://s1.mbcdnv4.xyz".toHttpUrl(), - 1, - 2, - TimeUnit.SECONDS - ) + .rateLimitHost( + "https://s1.mbcdnv4.xyz".toHttpUrl(), + 1, + 2, + TimeUnit.SECONDS ) - .addInterceptor( - SpecificHostRateLimitInterceptor( - "https://s1.mbcdnv5.xyz".toHttpUrl(), - 1, - 2, - TimeUnit.SECONDS - ) + .rateLimitHost( + "https://s1.mbcdnv5.xyz".toHttpUrl(), + 1, + 2, + TimeUnit.SECONDS ) .build() } diff --git a/multisrc/overrides/madtheme/toonifab/src/TooniFab.kt b/multisrc/overrides/madtheme/toonifab/src/TooniFab.kt index 92ed6515b..31410101e 100644 --- a/multisrc/overrides/madtheme/toonifab/src/TooniFab.kt +++ b/multisrc/overrides/madtheme/toonifab/src/TooniFab.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.en.toonifab -import eu.kanade.tachiyomi.lib.ratelimit.SpecificHostRateLimitInterceptor import eu.kanade.tachiyomi.multisrc.madtheme.MadTheme +import eu.kanade.tachiyomi.network.interceptor.rateLimitHost import okhttp3.HttpUrl.Companion.toHttpUrl import okhttp3.OkHttpClient import java.util.concurrent.TimeUnit @@ -12,45 +12,35 @@ class TooniFab : MadTheme( "en" ) { override val client: OkHttpClient = network.cloudflareClient.newBuilder() - .addInterceptor( - SpecificHostRateLimitInterceptor( - "https://s1.mbcdnv1.xyz".toHttpUrl(), - 5, - 1, - TimeUnit.SECONDS - ) + .rateLimitHost( + "https://s1.mbcdnv1.xyz".toHttpUrl(), + 5, + 1, + TimeUnit.SECONDS ) - .addInterceptor( - SpecificHostRateLimitInterceptor( - "https://s1.mbcdnv2.xyz".toHttpUrl(), - 1, - 2, - TimeUnit.SECONDS - ) + .rateLimitHost( + "https://s1.mbcdnv2.xyz".toHttpUrl(), + 1, + 2, + TimeUnit.SECONDS ) - .addInterceptor( - SpecificHostRateLimitInterceptor( - "https://s1.mbcdnv3.xyz".toHttpUrl(), - 1, - 2, - TimeUnit.SECONDS - ) + .rateLimitHost( + "https://s1.mbcdnv3.xyz".toHttpUrl(), + 1, + 2, + TimeUnit.SECONDS ) - .addInterceptor( - SpecificHostRateLimitInterceptor( - "https://s1.mbcdnv4.xyz".toHttpUrl(), - 1, - 2, - TimeUnit.SECONDS - ) + .rateLimitHost( + "https://s1.mbcdnv4.xyz".toHttpUrl(), + 1, + 2, + TimeUnit.SECONDS ) - .addInterceptor( - SpecificHostRateLimitInterceptor( - "https://s1.mbcdnv5.xyz".toHttpUrl(), - 1, - 2, - TimeUnit.SECONDS - ) + .rateLimitHost( + "https://s1.mbcdnv5.xyz".toHttpUrl(), + 1, + 2, + TimeUnit.SECONDS ) .build() } diff --git a/multisrc/overrides/madtheme/toonilyme/src/ToonilyMe.kt b/multisrc/overrides/madtheme/toonilyme/src/ToonilyMe.kt index 7f28aac88..f7a9f27ad 100644 --- a/multisrc/overrides/madtheme/toonilyme/src/ToonilyMe.kt +++ b/multisrc/overrides/madtheme/toonilyme/src/ToonilyMe.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.en.toonilyme -import eu.kanade.tachiyomi.lib.ratelimit.SpecificHostRateLimitInterceptor import eu.kanade.tachiyomi.multisrc.madtheme.MadTheme +import eu.kanade.tachiyomi.network.interceptor.rateLimitHost import okhttp3.HttpUrl.Companion.toHttpUrl import okhttp3.OkHttpClient import java.util.concurrent.TimeUnit @@ -12,45 +12,35 @@ class ToonilyMe : MadTheme( "en" ) { override val client: OkHttpClient = network.cloudflareClient.newBuilder() - .addInterceptor( - SpecificHostRateLimitInterceptor( - "https://s1.mbcdnv1.xyz".toHttpUrl(), - 5, - 1, - TimeUnit.SECONDS - ) + .rateLimitHost( + "https://s1.mbcdnv1.xyz".toHttpUrl(), + 5, + 1, + TimeUnit.SECONDS ) - .addInterceptor( - SpecificHostRateLimitInterceptor( - "https://s1.mbcdnv2.xyz".toHttpUrl(), - 1, - 2, - TimeUnit.SECONDS - ) + .rateLimitHost( + "https://s1.mbcdnv2.xyz".toHttpUrl(), + 1, + 2, + TimeUnit.SECONDS ) - .addInterceptor( - SpecificHostRateLimitInterceptor( - "https://s1.mbcdnv3.xyz".toHttpUrl(), - 1, - 2, - TimeUnit.SECONDS - ) + .rateLimitHost( + "https://s1.mbcdnv3.xyz".toHttpUrl(), + 1, + 2, + TimeUnit.SECONDS ) - .addInterceptor( - SpecificHostRateLimitInterceptor( - "https://s1.mbcdnv4.xyz".toHttpUrl(), - 1, - 2, - TimeUnit.SECONDS - ) + .rateLimitHost( + "https://s1.mbcdnv4.xyz".toHttpUrl(), + 1, + 2, + TimeUnit.SECONDS ) - .addInterceptor( - SpecificHostRateLimitInterceptor( - "https://s1.mbcdnv5.xyz".toHttpUrl(), - 1, - 2, - TimeUnit.SECONDS - ) + .rateLimitHost( + "https://s1.mbcdnv5.xyz".toHttpUrl(), + 1, + 2, + TimeUnit.SECONDS ) .build() } diff --git a/multisrc/overrides/madtheme/toonitube/src/TooniTube.kt b/multisrc/overrides/madtheme/toonitube/src/TooniTube.kt index 209e7d30f..60ca50949 100644 --- a/multisrc/overrides/madtheme/toonitube/src/TooniTube.kt +++ b/multisrc/overrides/madtheme/toonitube/src/TooniTube.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.en.toonitube -import eu.kanade.tachiyomi.lib.ratelimit.SpecificHostRateLimitInterceptor import eu.kanade.tachiyomi.multisrc.madtheme.MadTheme +import eu.kanade.tachiyomi.network.interceptor.rateLimitHost import okhttp3.HttpUrl.Companion.toHttpUrl import okhttp3.OkHttpClient import java.util.concurrent.TimeUnit @@ -12,45 +12,35 @@ class TooniTube : MadTheme( "en" ) { override val client: OkHttpClient = network.cloudflareClient.newBuilder() - .addInterceptor( - SpecificHostRateLimitInterceptor( - "https://s1.mbcdnv1.xyz".toHttpUrl(), - 5, - 1, - TimeUnit.SECONDS - ) + .rateLimitHost( + "https://s1.mbcdnv1.xyz".toHttpUrl(), + 5, + 1, + TimeUnit.SECONDS ) - .addInterceptor( - SpecificHostRateLimitInterceptor( - "https://s1.mbcdnv2.xyz".toHttpUrl(), - 1, - 2, - TimeUnit.SECONDS - ) + .rateLimitHost( + "https://s1.mbcdnv2.xyz".toHttpUrl(), + 1, + 2, + TimeUnit.SECONDS ) - .addInterceptor( - SpecificHostRateLimitInterceptor( - "https://s1.mbcdnv3.xyz".toHttpUrl(), - 1, - 2, - TimeUnit.SECONDS - ) + .rateLimitHost( + "https://s1.mbcdnv3.xyz".toHttpUrl(), + 1, + 2, + TimeUnit.SECONDS ) - .addInterceptor( - SpecificHostRateLimitInterceptor( - "https://s1.mbcdnv4.xyz".toHttpUrl(), - 1, - 2, - TimeUnit.SECONDS - ) + .rateLimitHost( + "https://s1.mbcdnv4.xyz".toHttpUrl(), + 1, + 2, + TimeUnit.SECONDS ) - .addInterceptor( - SpecificHostRateLimitInterceptor( - "https://s1.mbcdnv5.xyz".toHttpUrl(), - 1, - 2, - TimeUnit.SECONDS - ) + .rateLimitHost( + "https://s1.mbcdnv5.xyz".toHttpUrl(), + 1, + 2, + TimeUnit.SECONDS ) .build() } diff --git a/multisrc/overrides/madtheme/truemanga/src/TrueManga.kt b/multisrc/overrides/madtheme/truemanga/src/TrueManga.kt index 212a82af0..b5852735f 100644 --- a/multisrc/overrides/madtheme/truemanga/src/TrueManga.kt +++ b/multisrc/overrides/madtheme/truemanga/src/TrueManga.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.en.truemanga -import eu.kanade.tachiyomi.lib.ratelimit.SpecificHostRateLimitInterceptor import eu.kanade.tachiyomi.multisrc.madtheme.MadTheme +import eu.kanade.tachiyomi.network.interceptor.rateLimitHost import okhttp3.HttpUrl.Companion.toHttpUrl import okhttp3.OkHttpClient import java.util.concurrent.TimeUnit @@ -12,45 +12,35 @@ class TrueManga : MadTheme( "en" ) { override val client: OkHttpClient = network.cloudflareClient.newBuilder() - .addInterceptor( - SpecificHostRateLimitInterceptor( - "https://s1.mbcdnv1.xyz".toHttpUrl(), - 5, - 1, - TimeUnit.SECONDS - ) + .rateLimitHost( + "https://s1.mbcdnv1.xyz".toHttpUrl(), + 5, + 1, + TimeUnit.SECONDS ) - .addInterceptor( - SpecificHostRateLimitInterceptor( - "https://s1.mbcdnv2.xyz".toHttpUrl(), - 1, - 2, - TimeUnit.SECONDS - ) + .rateLimitHost( + "https://s1.mbcdnv2.xyz".toHttpUrl(), + 1, + 2, + TimeUnit.SECONDS ) - .addInterceptor( - SpecificHostRateLimitInterceptor( - "https://s1.mbcdnv3.xyz".toHttpUrl(), - 1, - 2, - TimeUnit.SECONDS - ) + .rateLimitHost( + "https://s1.mbcdnv3.xyz".toHttpUrl(), + 1, + 2, + TimeUnit.SECONDS ) - .addInterceptor( - SpecificHostRateLimitInterceptor( - "https://s1.mbcdnv4.xyz".toHttpUrl(), - 1, - 2, - TimeUnit.SECONDS - ) + .rateLimitHost( + "https://s1.mbcdnv4.xyz".toHttpUrl(), + 1, + 2, + TimeUnit.SECONDS ) - .addInterceptor( - SpecificHostRateLimitInterceptor( - "https://s1.mbcdnv5.xyz".toHttpUrl(), - 1, - 2, - TimeUnit.SECONDS - ) + .rateLimitHost( + "https://s1.mbcdnv5.xyz".toHttpUrl(), + 1, + 2, + TimeUnit.SECONDS ) .build() } diff --git a/multisrc/overrides/mangahub/default/additional.gradle.kts b/multisrc/overrides/mangahub/default/additional.gradle.kts deleted file mode 100644 index 10beb8157..000000000 --- a/multisrc/overrides/mangahub/default/additional.gradle.kts +++ /dev/null @@ -1,4 +0,0 @@ - -dependencies { - implementation project(':lib-ratelimit') -} diff --git a/multisrc/overrides/mangahub/mangafoxfun/src/MangaFoxFun.kt b/multisrc/overrides/mangahub/mangafoxfun/src/MangaFoxFun.kt index b9d3b8e13..83de84cf6 100644 --- a/multisrc/overrides/mangahub/mangafoxfun/src/MangaFoxFun.kt +++ b/multisrc/overrides/mangahub/mangafoxfun/src/MangaFoxFun.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.en.mangafoxfun -import eu.kanade.tachiyomi.lib.ratelimit.SpecificHostRateLimitInterceptor import eu.kanade.tachiyomi.multisrc.mangahub.MangaHub +import eu.kanade.tachiyomi.network.interceptor.rateLimitHost import okhttp3.OkHttpClient class MangaFoxFun : MangaHub( @@ -10,7 +10,7 @@ class MangaFoxFun : MangaHub( "en" ) { override val client: OkHttpClient = super.client.newBuilder() - .addInterceptor(SpecificHostRateLimitInterceptor(cdnHost, 1, 2)) + .rateLimitHost(cdnHost, 1, 2) .build() override val serverId = "mf01" diff --git a/multisrc/overrides/mangahub/mangahereonl/src/MangaHereOnl.kt b/multisrc/overrides/mangahub/mangahereonl/src/MangaHereOnl.kt index 78a79f140..77e97f9ec 100644 --- a/multisrc/overrides/mangahub/mangahereonl/src/MangaHereOnl.kt +++ b/multisrc/overrides/mangahub/mangahereonl/src/MangaHereOnl.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.en.mangahereonl -import eu.kanade.tachiyomi.lib.ratelimit.SpecificHostRateLimitInterceptor import eu.kanade.tachiyomi.multisrc.mangahub.MangaHub +import eu.kanade.tachiyomi.network.interceptor.rateLimitHost import okhttp3.OkHttpClient class MangaHereOnl : MangaHub( @@ -10,7 +10,7 @@ class MangaHereOnl : MangaHub( "en" ) { override val client: OkHttpClient = super.client.newBuilder() - .addInterceptor(SpecificHostRateLimitInterceptor(cdnHost, 1, 2)) + .rateLimitHost(cdnHost, 1, 2) .build() override val serverId = "mh01" diff --git a/multisrc/overrides/mangahub/mangahubio/src/MangaHubIo.kt b/multisrc/overrides/mangahub/mangahubio/src/MangaHubIo.kt index 7bb66d476..32fd1dcfe 100644 --- a/multisrc/overrides/mangahub/mangahubio/src/MangaHubIo.kt +++ b/multisrc/overrides/mangahub/mangahubio/src/MangaHubIo.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.en.mangahubio -import eu.kanade.tachiyomi.lib.ratelimit.SpecificHostRateLimitInterceptor import eu.kanade.tachiyomi.multisrc.mangahub.MangaHub +import eu.kanade.tachiyomi.network.interceptor.rateLimitHost import okhttp3.OkHttpClient class MangaHubIo : MangaHub( @@ -10,7 +10,7 @@ class MangaHubIo : MangaHub( "en" ) { override val client: OkHttpClient = super.client.newBuilder() - .addInterceptor(SpecificHostRateLimitInterceptor(cdnHost, 1, 2)) + .rateLimitHost(cdnHost, 1, 2) .build() override val serverId = "m01" diff --git a/multisrc/overrides/mangahub/mangakakalotfun/src/MangakakalotFun.kt b/multisrc/overrides/mangahub/mangakakalotfun/src/MangakakalotFun.kt index 4c933e6e2..a91793dd0 100644 --- a/multisrc/overrides/mangahub/mangakakalotfun/src/MangakakalotFun.kt +++ b/multisrc/overrides/mangahub/mangakakalotfun/src/MangakakalotFun.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.en.mangakakalotfun -import eu.kanade.tachiyomi.lib.ratelimit.SpecificHostRateLimitInterceptor import eu.kanade.tachiyomi.multisrc.mangahub.MangaHub +import eu.kanade.tachiyomi.network.interceptor.rateLimitHost import okhttp3.OkHttpClient class MangakakalotFun : MangaHub( @@ -10,7 +10,7 @@ class MangakakalotFun : MangaHub( "en" ) { override val client: OkHttpClient = super.client.newBuilder() - .addInterceptor(SpecificHostRateLimitInterceptor(cdnHost, 1, 2)) + .rateLimitHost(cdnHost, 1, 2) .build() override val serverId = "mn01" diff --git a/multisrc/overrides/mangahub/manganel/src/MangaNel.kt b/multisrc/overrides/mangahub/manganel/src/MangaNel.kt index d90e4a279..47eb21506 100644 --- a/multisrc/overrides/mangahub/manganel/src/MangaNel.kt +++ b/multisrc/overrides/mangahub/manganel/src/MangaNel.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.en.manganel -import eu.kanade.tachiyomi.lib.ratelimit.SpecificHostRateLimitInterceptor import eu.kanade.tachiyomi.multisrc.mangahub.MangaHub +import eu.kanade.tachiyomi.network.interceptor.rateLimitHost import okhttp3.OkHttpClient class MangaNel : MangaHub( @@ -10,7 +10,7 @@ class MangaNel : MangaHub( "en" ) { override val client: OkHttpClient = super.client.newBuilder() - .addInterceptor(SpecificHostRateLimitInterceptor(cdnHost, 1, 2)) + .rateLimitHost(cdnHost, 1, 2) .build() override val serverId = "mn05" diff --git a/multisrc/overrides/mangahub/mangaonlinefun/src/MangaOnlineFun.kt b/multisrc/overrides/mangahub/mangaonlinefun/src/MangaOnlineFun.kt index d7122e78f..f4e30bb36 100644 --- a/multisrc/overrides/mangahub/mangaonlinefun/src/MangaOnlineFun.kt +++ b/multisrc/overrides/mangahub/mangaonlinefun/src/MangaOnlineFun.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.en.mangaonlinefun -import eu.kanade.tachiyomi.lib.ratelimit.SpecificHostRateLimitInterceptor import eu.kanade.tachiyomi.multisrc.mangahub.MangaHub +import eu.kanade.tachiyomi.network.interceptor.rateLimitHost import okhttp3.OkHttpClient class MangaOnlineFun : MangaHub( @@ -10,7 +10,7 @@ class MangaOnlineFun : MangaHub( "en" ) { override val client: OkHttpClient = super.client.newBuilder() - .addInterceptor(SpecificHostRateLimitInterceptor(cdnHost, 1, 2)) + .rateLimitHost(cdnHost, 1, 2) .build() override val serverId = "m02" diff --git a/multisrc/overrides/mangahub/mangapandaonl/src/MangaPandaOnl.kt b/multisrc/overrides/mangahub/mangapandaonl/src/MangaPandaOnl.kt index 1a04ff65c..6a1ce1c3c 100644 --- a/multisrc/overrides/mangahub/mangapandaonl/src/MangaPandaOnl.kt +++ b/multisrc/overrides/mangahub/mangapandaonl/src/MangaPandaOnl.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.en.mangapandaonl -import eu.kanade.tachiyomi.lib.ratelimit.SpecificHostRateLimitInterceptor import eu.kanade.tachiyomi.multisrc.mangahub.MangaHub +import eu.kanade.tachiyomi.network.interceptor.rateLimitHost import okhttp3.OkHttpClient class MangaPandaOnl : MangaHub( @@ -10,7 +10,7 @@ class MangaPandaOnl : MangaHub( "en" ) { override val client: OkHttpClient = super.client.newBuilder() - .addInterceptor(SpecificHostRateLimitInterceptor(cdnHost, 1, 2)) + .rateLimitHost(cdnHost, 1, 2) .build() override val serverId = "mr02" diff --git a/multisrc/overrides/mangahub/mangareadersite/src/MangaReaderSite.kt b/multisrc/overrides/mangahub/mangareadersite/src/MangaReaderSite.kt index 27ae77738..481b11a1b 100644 --- a/multisrc/overrides/mangahub/mangareadersite/src/MangaReaderSite.kt +++ b/multisrc/overrides/mangahub/mangareadersite/src/MangaReaderSite.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.en.mangareadersite -import eu.kanade.tachiyomi.lib.ratelimit.SpecificHostRateLimitInterceptor import eu.kanade.tachiyomi.multisrc.mangahub.MangaHub +import eu.kanade.tachiyomi.network.interceptor.rateLimitHost import okhttp3.OkHttpClient class MangaReaderSite : MangaHub( @@ -10,7 +10,7 @@ class MangaReaderSite : MangaHub( "en" ) { override val client: OkHttpClient = super.client.newBuilder() - .addInterceptor(SpecificHostRateLimitInterceptor(cdnHost, 1, 2)) + .rateLimitHost(cdnHost, 1, 2) .build() override val serverId = "mr01" diff --git a/multisrc/overrides/mangahub/mangatoday/src/MangaToday.kt b/multisrc/overrides/mangahub/mangatoday/src/MangaToday.kt index 313bf2720..630e36b2f 100644 --- a/multisrc/overrides/mangahub/mangatoday/src/MangaToday.kt +++ b/multisrc/overrides/mangahub/mangatoday/src/MangaToday.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.en.mangatoday -import eu.kanade.tachiyomi.lib.ratelimit.SpecificHostRateLimitInterceptor import eu.kanade.tachiyomi.multisrc.mangahub.MangaHub +import eu.kanade.tachiyomi.network.interceptor.rateLimitHost import okhttp3.OkHttpClient class MangaToday : MangaHub( @@ -10,7 +10,7 @@ class MangaToday : MangaHub( "en" ) { override val client: OkHttpClient = super.client.newBuilder() - .addInterceptor(SpecificHostRateLimitInterceptor(cdnHost, 1, 2)) + .rateLimitHost(cdnHost, 1, 2) .build() override val serverId = "m03" diff --git a/multisrc/overrides/mangahub/mangatownhub/src/MangaTownHub.kt b/multisrc/overrides/mangahub/mangatownhub/src/MangaTownHub.kt index 5c91ae38e..febccb3e2 100644 --- a/multisrc/overrides/mangahub/mangatownhub/src/MangaTownHub.kt +++ b/multisrc/overrides/mangahub/mangatownhub/src/MangaTownHub.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.en.mangatownhub -import eu.kanade.tachiyomi.lib.ratelimit.SpecificHostRateLimitInterceptor import eu.kanade.tachiyomi.multisrc.mangahub.MangaHub +import eu.kanade.tachiyomi.network.interceptor.rateLimitHost import okhttp3.OkHttpClient class MangaTownHub : MangaHub( @@ -10,7 +10,7 @@ class MangaTownHub : MangaHub( "en" ) { override val client: OkHttpClient = super.client.newBuilder() - .addInterceptor(SpecificHostRateLimitInterceptor(cdnHost, 1, 2)) + .rateLimitHost(cdnHost, 1, 2) .build() override val serverId = "mt01" diff --git a/multisrc/overrides/mangahub/onemangaco/src/OneMangaCo.kt b/multisrc/overrides/mangahub/onemangaco/src/OneMangaCo.kt index af09a28db..f2e30da9c 100644 --- a/multisrc/overrides/mangahub/onemangaco/src/OneMangaCo.kt +++ b/multisrc/overrides/mangahub/onemangaco/src/OneMangaCo.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.en.onemangaco -import eu.kanade.tachiyomi.lib.ratelimit.SpecificHostRateLimitInterceptor import eu.kanade.tachiyomi.multisrc.mangahub.MangaHub +import eu.kanade.tachiyomi.network.interceptor.rateLimitHost import okhttp3.OkHttpClient class OneMangaCo : MangaHub( @@ -10,7 +10,7 @@ class OneMangaCo : MangaHub( "en" ) { override val client: OkHttpClient = super.client.newBuilder() - .addInterceptor(SpecificHostRateLimitInterceptor(cdnHost, 1, 2)) + .rateLimitHost(cdnHost, 1, 2) .build() override val serverId = "mn03" diff --git a/multisrc/overrides/mangahub/onemangainfo/src/OneMangaInfo.kt b/multisrc/overrides/mangahub/onemangainfo/src/OneMangaInfo.kt index a8aed6b94..762afbe0c 100644 --- a/multisrc/overrides/mangahub/onemangainfo/src/OneMangaInfo.kt +++ b/multisrc/overrides/mangahub/onemangainfo/src/OneMangaInfo.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.en.onemangainfo -import eu.kanade.tachiyomi.lib.ratelimit.SpecificHostRateLimitInterceptor import eu.kanade.tachiyomi.multisrc.mangahub.MangaHub +import eu.kanade.tachiyomi.network.interceptor.rateLimitHost import okhttp3.OkHttpClient class OneMangaInfo : MangaHub( @@ -10,7 +10,7 @@ class OneMangaInfo : MangaHub( "en" ) { override val client: OkHttpClient = super.client.newBuilder() - .addInterceptor(SpecificHostRateLimitInterceptor(cdnHost, 1, 2)) + .rateLimitHost(cdnHost, 1, 2) .build() override val serverId = "mn02" diff --git a/multisrc/overrides/mangasar/default/additional.gradle.kts b/multisrc/overrides/mangasar/default/additional.gradle.kts deleted file mode 100644 index 10beb8157..000000000 --- a/multisrc/overrides/mangasar/default/additional.gradle.kts +++ /dev/null @@ -1,4 +0,0 @@ - -dependencies { - implementation project(':lib-ratelimit') -} diff --git a/multisrc/overrides/mangasar/mangatube/src/MangaTube.kt b/multisrc/overrides/mangasar/mangatube/src/MangaTube.kt index 876dc3952..37be5f0c7 100644 --- a/multisrc/overrides/mangasar/mangatube/src/MangaTube.kt +++ b/multisrc/overrides/mangasar/mangatube/src/MangaTube.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.pt.mangatube -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.mangasar.MangaSar +import eu.kanade.tachiyomi.network.interceptor.rateLimit import okhttp3.OkHttpClient import java.util.concurrent.TimeUnit @@ -13,6 +13,6 @@ class MangaTube : MangaSar( override val client: OkHttpClient = super.client.newBuilder() .addInterceptor(::searchIntercept) - .addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) + .rateLimit(1, 2, TimeUnit.SECONDS) .build() } diff --git a/multisrc/overrides/mangasar/meusmangas/src/MeusMangas.kt b/multisrc/overrides/mangasar/meusmangas/src/MeusMangas.kt index 90be80994..56938dc27 100644 --- a/multisrc/overrides/mangasar/meusmangas/src/MeusMangas.kt +++ b/multisrc/overrides/mangasar/meusmangas/src/MeusMangas.kt @@ -1,8 +1,8 @@ package eu.kanade.tachiyomi.extension.pt.meusmangas -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.mangasar.MangaSar import eu.kanade.tachiyomi.network.GET +import eu.kanade.tachiyomi.network.interceptor.rateLimit import eu.kanade.tachiyomi.source.model.MangasPage import eu.kanade.tachiyomi.source.model.SChapter import eu.kanade.tachiyomi.source.model.SManga @@ -21,7 +21,7 @@ class MeusMangas : MangaSar( override val client: OkHttpClient = super.client.newBuilder() .addInterceptor(::searchIntercept) - .addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) + .rateLimit(1, 2, TimeUnit.SECONDS) .build() override fun popularMangaSelector() = "ul.sidebar-popular li.popular-treending" diff --git a/multisrc/overrides/mmrcms/amascans/src/AmaScans.kt b/multisrc/overrides/mmrcms/amascans/src/AmaScans.kt index 3d468b4de..4cd90eabc 100644 --- a/multisrc/overrides/mmrcms/amascans/src/AmaScans.kt +++ b/multisrc/overrides/mmrcms/amascans/src/AmaScans.kt @@ -1,8 +1,8 @@ package eu.kanade.tachiyomi.extension.pt.amascans -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.mmrcms.MMRCMS import eu.kanade.tachiyomi.network.GET +import eu.kanade.tachiyomi.network.interceptor.rateLimit import eu.kanade.tachiyomi.source.model.Page import okhttp3.OkHttpClient import okhttp3.Request @@ -11,7 +11,7 @@ import java.util.concurrent.TimeUnit class AmaScans : MMRCMS("Ama Scans", "https://amascan.com", "pt-BR") { override val client: OkHttpClient = super.client.newBuilder() - .addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) + .rateLimit(1, 2, TimeUnit.SECONDS) .build() override fun imageRequest(page: Page): Request { diff --git a/multisrc/overrides/mmrcms/animaregia/src/AnimaRegia.kt b/multisrc/overrides/mmrcms/animaregia/src/AnimaRegia.kt index cab24d9cc..bbc81b218 100644 --- a/multisrc/overrides/mmrcms/animaregia/src/AnimaRegia.kt +++ b/multisrc/overrides/mmrcms/animaregia/src/AnimaRegia.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.pt.animaregia -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.mmrcms.MMRCMS +import eu.kanade.tachiyomi.network.interceptor.rateLimit import eu.kanade.tachiyomi.source.model.MangasPage import eu.kanade.tachiyomi.source.model.SChapter import eu.kanade.tachiyomi.source.model.SManga @@ -18,7 +18,7 @@ class AnimaRegia : MMRCMS("AnimaRegia", "https://animaregia.net", "pt-BR") { override val id: Long = 4378659695320121364 override val client: OkHttpClient = super.client.newBuilder() - .addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) + .rateLimit(1, 2, TimeUnit.SECONDS) .build() // Remove the language tag from the title name. diff --git a/multisrc/overrides/mmrcms/default/additional.gradle.kts b/multisrc/overrides/mmrcms/default/additional.gradle.kts deleted file mode 100644 index 10beb8157..000000000 --- a/multisrc/overrides/mmrcms/default/additional.gradle.kts +++ /dev/null @@ -1,4 +0,0 @@ - -dependencies { - implementation project(':lib-ratelimit') -} diff --git a/multisrc/overrides/mmrcms/gekkouhentai/src/GekkouHentai.kt b/multisrc/overrides/mmrcms/gekkouhentai/src/GekkouHentai.kt index 4a2ab4fb7..a81f27042 100644 --- a/multisrc/overrides/mmrcms/gekkouhentai/src/GekkouHentai.kt +++ b/multisrc/overrides/mmrcms/gekkouhentai/src/GekkouHentai.kt @@ -1,8 +1,8 @@ package eu.kanade.tachiyomi.extension.pt.gekkouhentai -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.mmrcms.MMRCMS import eu.kanade.tachiyomi.network.GET +import eu.kanade.tachiyomi.network.interceptor.rateLimit import eu.kanade.tachiyomi.source.model.Page import okhttp3.OkHttpClient import okhttp3.Request @@ -15,7 +15,7 @@ class GekkouHentai : MMRCMS( ) { override val client: OkHttpClient = super.client.newBuilder() - .addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) + .rateLimit(1, 2, TimeUnit.SECONDS) .build() override fun chapterListSelector() = "ul.domaintld > li.li:has(a[href^='$baseUrl'])" diff --git a/multisrc/overrides/mmrcms/gekkouscan/src/GekkouScans.kt b/multisrc/overrides/mmrcms/gekkouscan/src/GekkouScans.kt index df7b5dd86..ad02e44c8 100644 --- a/multisrc/overrides/mmrcms/gekkouscan/src/GekkouScans.kt +++ b/multisrc/overrides/mmrcms/gekkouscan/src/GekkouScans.kt @@ -1,8 +1,8 @@ package eu.kanade.tachiyomi.extension.pt.gekkouscan -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.mmrcms.MMRCMS import eu.kanade.tachiyomi.network.GET +import eu.kanade.tachiyomi.network.interceptor.rateLimit import eu.kanade.tachiyomi.source.model.Page import eu.kanade.tachiyomi.source.model.SChapter import eu.kanade.tachiyomi.util.asJsoup @@ -18,7 +18,7 @@ class GekkouScans : MMRCMS( ) { override val client: OkHttpClient = super.client.newBuilder() - .addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) + .rateLimit(1, 2, TimeUnit.SECONDS) .build() override fun chapterListParse(response: Response): List { diff --git a/multisrc/overrides/nepnep/default/additional.gradle.kts b/multisrc/overrides/nepnep/default/additional.gradle.kts deleted file mode 100644 index 27b5b96f7..000000000 --- a/multisrc/overrides/nepnep/default/additional.gradle.kts +++ /dev/null @@ -1,3 +0,0 @@ -dependencies { - implementation project(':lib-ratelimit') -} diff --git a/multisrc/overrides/nepnep/mangalife/src/MangaLife.kt b/multisrc/overrides/nepnep/mangalife/src/MangaLife.kt index d1376f62e..a26ad08c9 100644 --- a/multisrc/overrides/nepnep/mangalife/src/MangaLife.kt +++ b/multisrc/overrides/nepnep/mangalife/src/MangaLife.kt @@ -1,16 +1,14 @@ package eu.kanade.tachiyomi.extension.en.mangalife -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.nepnep.NepNep +import eu.kanade.tachiyomi.network.interceptor.rateLimit import okhttp3.OkHttpClient import java.util.concurrent.TimeUnit class MangaLife : NepNep("MangaLife", "https://manga4life.com", "en") { - private val rateLimitInterceptor = RateLimitInterceptor(1, 2) - override val client: OkHttpClient = network.cloudflareClient.newBuilder() - .addNetworkInterceptor(rateLimitInterceptor) + .rateLimit(1, 2) .connectTimeout(1, TimeUnit.MINUTES) .readTimeout(1, TimeUnit.MINUTES) .writeTimeout(1, TimeUnit.MINUTES) diff --git a/multisrc/overrides/nepnep/mangasee/src/MangaSee.kt b/multisrc/overrides/nepnep/mangasee/src/MangaSee.kt index 3815424a6..d9ebb2f8d 100644 --- a/multisrc/overrides/nepnep/mangasee/src/MangaSee.kt +++ b/multisrc/overrides/nepnep/mangasee/src/MangaSee.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.en.mangasee -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.nepnep.NepNep +import eu.kanade.tachiyomi.network.interceptor.rateLimit import okhttp3.OkHttpClient import java.util.concurrent.TimeUnit @@ -9,10 +9,8 @@ class MangaSee : NepNep("MangaSee", "https://mangasee123.com", "en") { override val id: Long = 9 - private val rateLimitInterceptor = RateLimitInterceptor(1, 2) - override val client: OkHttpClient = network.cloudflareClient.newBuilder() - .addNetworkInterceptor(rateLimitInterceptor) + .rateLimit(1, 2) .connectTimeout(1, TimeUnit.MINUTES) .readTimeout(1, TimeUnit.MINUTES) .writeTimeout(1, TimeUnit.MINUTES) diff --git a/multisrc/overrides/wpmangareader/default/additional.gradle.kts b/multisrc/overrides/wpmangareader/default/additional.gradle.kts deleted file mode 100644 index 10beb8157..000000000 --- a/multisrc/overrides/wpmangareader/default/additional.gradle.kts +++ /dev/null @@ -1,4 +0,0 @@ - -dependencies { - implementation project(':lib-ratelimit') -} diff --git a/multisrc/overrides/wpmangareader/flamescans/additional.gradle.kts b/multisrc/overrides/wpmangareader/flamescans/additional.gradle.kts deleted file mode 100644 index 27b5b96f7..000000000 --- a/multisrc/overrides/wpmangareader/flamescans/additional.gradle.kts +++ /dev/null @@ -1,3 +0,0 @@ -dependencies { - implementation project(':lib-ratelimit') -} diff --git a/multisrc/overrides/wpmangareader/flamescans/src/FlameScansFactory.kt b/multisrc/overrides/wpmangareader/flamescans/src/FlameScansFactory.kt index b33941da4..85a4e6f2a 100644 --- a/multisrc/overrides/wpmangareader/flamescans/src/FlameScansFactory.kt +++ b/multisrc/overrides/wpmangareader/flamescans/src/FlameScansFactory.kt @@ -1,6 +1,6 @@ package eu.kanade.tachiyomi.extension.all.flamescans -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor +import eu.kanade.tachiyomi.network.interceptor.rateLimit import eu.kanade.tachiyomi.source.SourceFactory import eu.kanade.tachiyomi.source.model.SManga import okhttp3.OkHttpClient @@ -15,7 +15,7 @@ class FlameScansFactory : SourceFactory { class FlameScansAr : FlameScans("https://ar.flamescans.org", "ar", "/series") { override val client: OkHttpClient = super.client.newBuilder() - .addInterceptor(RateLimitInterceptor(1, 1, TimeUnit.SECONDS)) + .rateLimit(1, 1, TimeUnit.SECONDS) .build() override val id: Long = 6053688312544266540 @@ -29,6 +29,6 @@ class FlameScansAr : FlameScans("https://ar.flamescans.org", "ar", "/series") { class FlameScansEn : FlameScans("https://flamescans.org", "en", "/series") { override val client: OkHttpClient = super.client.newBuilder() - .addInterceptor(RateLimitInterceptor(1, 3, TimeUnit.SECONDS)) + .rateLimit(1, 3, TimeUnit.SECONDS) .build() } diff --git a/multisrc/overrides/wpmangareader/franxxmangas/src/FranxxMangas.kt b/multisrc/overrides/wpmangareader/franxxmangas/src/FranxxMangas.kt index 95e2fccbc..ecd79f2df 100644 --- a/multisrc/overrides/wpmangareader/franxxmangas/src/FranxxMangas.kt +++ b/multisrc/overrides/wpmangareader/franxxmangas/src/FranxxMangas.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.pt.franxxmangas -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.wpmangareader.WPMangaReader +import eu.kanade.tachiyomi.network.interceptor.rateLimit import eu.kanade.tachiyomi.source.model.SManga import okhttp3.OkHttpClient import org.jsoup.nodes.Element @@ -17,7 +17,7 @@ class FranxxMangas : WPMangaReader( ) { override val client: OkHttpClient = network.cloudflareClient.newBuilder() - .addNetworkInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) + .rateLimit(1, 2, TimeUnit.SECONDS) .build() override val altName = "Nomes alternativos: " diff --git a/multisrc/overrides/wpmangareader/fusionscanlation/additional.gradle.kts b/multisrc/overrides/wpmangareader/fusionscanlation/additional.gradle.kts deleted file mode 100644 index 10beb8157..000000000 --- a/multisrc/overrides/wpmangareader/fusionscanlation/additional.gradle.kts +++ /dev/null @@ -1,4 +0,0 @@ - -dependencies { - implementation project(':lib-ratelimit') -} diff --git a/multisrc/overrides/wpmangareader/fusionscanlation/src/FusionScanlation.kt b/multisrc/overrides/wpmangareader/fusionscanlation/src/FusionScanlation.kt index 23d5be570..5cad1c76f 100644 --- a/multisrc/overrides/wpmangareader/fusionscanlation/src/FusionScanlation.kt +++ b/multisrc/overrides/wpmangareader/fusionscanlation/src/FusionScanlation.kt @@ -1,18 +1,17 @@ package eu.kanade.tachiyomi.extension.es.fusionscanlation -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.wpmangareader.WPMangaReader +import eu.kanade.tachiyomi.network.interceptor.rateLimit import okhttp3.OkHttpClient import java.text.SimpleDateFormat import java.util.Locale import java.util.concurrent.TimeUnit class FusionScanlation : WPMangaReader("Fusion Scanlation", "https://fusionscanlation.com", "es", dateFormat = SimpleDateFormat("MMMM dd, yyyy", Locale("es"))) { - private val rateLimitInterceptor = RateLimitInterceptor(1, 2) override val client: OkHttpClient = network.cloudflareClient.newBuilder() .connectTimeout(10, TimeUnit.SECONDS) .readTimeout(30, TimeUnit.SECONDS) - .addNetworkInterceptor(rateLimitInterceptor) + .rateLimit(1, 2) .build() } diff --git a/multisrc/overrides/wpmangareader/kiryuu/additional.gradle.kts b/multisrc/overrides/wpmangareader/kiryuu/additional.gradle.kts deleted file mode 100644 index 10beb8157..000000000 --- a/multisrc/overrides/wpmangareader/kiryuu/additional.gradle.kts +++ /dev/null @@ -1,4 +0,0 @@ - -dependencies { - implementation project(':lib-ratelimit') -} diff --git a/multisrc/overrides/wpmangareader/kiryuu/src/Kiryuu.kt b/multisrc/overrides/wpmangareader/kiryuu/src/Kiryuu.kt index fd6bf2577..0e0d784fc 100644 --- a/multisrc/overrides/wpmangareader/kiryuu/src/Kiryuu.kt +++ b/multisrc/overrides/wpmangareader/kiryuu/src/Kiryuu.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.id.kiryuu -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.wpmangareader.WPMangaReader +import eu.kanade.tachiyomi.network.interceptor.rateLimit import eu.kanade.tachiyomi.source.model.SManga import okhttp3.OkHttpClient import org.jsoup.nodes.Document @@ -13,12 +13,10 @@ class Kiryuu : WPMangaReader("Kiryuu", "https://kiryuu.id", "id", dateFormat = S // Formerly "Kiryuu (WP Manga Stream)" override val id = 3639673976007021338 - private val rateLimitInterceptor = RateLimitInterceptor(4) - override val client: OkHttpClient = network.cloudflareClient.newBuilder() .connectTimeout(10, TimeUnit.SECONDS) .readTimeout(30, TimeUnit.SECONDS) - .addNetworkInterceptor(rateLimitInterceptor) + .rateLimit(4) .build() // manga details diff --git a/multisrc/overrides/wpmangareader/mangaschan/src/MangasChan.kt b/multisrc/overrides/wpmangareader/mangaschan/src/MangasChan.kt index 2f1cee7d7..315fb39bc 100644 --- a/multisrc/overrides/wpmangareader/mangaschan/src/MangasChan.kt +++ b/multisrc/overrides/wpmangareader/mangaschan/src/MangasChan.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.pt.mangaschan -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.wpmangareader.WPMangaReader +import eu.kanade.tachiyomi.network.interceptor.rateLimit import okhttp3.OkHttpClient import java.text.SimpleDateFormat import java.util.Locale @@ -15,7 +15,7 @@ class MangasChan : WPMangaReader( ) { override val client: OkHttpClient = network.cloudflareClient.newBuilder() - .addNetworkInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) + .rateLimit(1, 2, TimeUnit.SECONDS) .build() override val altName = "Nome alternativo: " diff --git a/multisrc/overrides/wpmangareader/modescanlator/src/ModeScanlator.kt b/multisrc/overrides/wpmangareader/modescanlator/src/ModeScanlator.kt index 0bcdd8b79..7f7d0ee0a 100644 --- a/multisrc/overrides/wpmangareader/modescanlator/src/ModeScanlator.kt +++ b/multisrc/overrides/wpmangareader/modescanlator/src/ModeScanlator.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.pt.modescanlator -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.wpmangareader.WPMangaReader +import eu.kanade.tachiyomi.network.interceptor.rateLimit import okhttp3.OkHttpClient import java.text.SimpleDateFormat import java.util.Locale @@ -18,7 +18,7 @@ class ModeScanlator : WPMangaReader( override val versionId: Int = 2 override val client: OkHttpClient = network.cloudflareClient.newBuilder() - .addNetworkInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) + .rateLimit(1, 2, TimeUnit.SECONDS) .build() override val altName = "Nome alternativo: " diff --git a/multisrc/overrides/wpmangareader/origamiorpheans/src/OrigamiOrpheans.kt b/multisrc/overrides/wpmangareader/origamiorpheans/src/OrigamiOrpheans.kt index 239e3c3ca..265603789 100644 --- a/multisrc/overrides/wpmangareader/origamiorpheans/src/OrigamiOrpheans.kt +++ b/multisrc/overrides/wpmangareader/origamiorpheans/src/OrigamiOrpheans.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.pt.origamiorpheans -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.wpmangareader.WPMangaReader +import eu.kanade.tachiyomi.network.interceptor.rateLimit import okhttp3.OkHttpClient import java.text.SimpleDateFormat import java.util.Locale @@ -18,7 +18,7 @@ class OrigamiOrpheans : WPMangaReader( override val versionId = 2 override val client: OkHttpClient = network.cloudflareClient.newBuilder() - .addNetworkInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) + .rateLimit(1, 2, TimeUnit.SECONDS) .build() override val altName = "Nomes alternativos: " diff --git a/multisrc/overrides/wpmangareader/realmscans/src/RealmScans.kt b/multisrc/overrides/wpmangareader/realmscans/src/RealmScans.kt index 150d9847d..63c0b9d78 100644 --- a/multisrc/overrides/wpmangareader/realmscans/src/RealmScans.kt +++ b/multisrc/overrides/wpmangareader/realmscans/src/RealmScans.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.en.realmscans -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.wpmangareader.WPMangaReader +import eu.kanade.tachiyomi.network.interceptor.rateLimit import eu.kanade.tachiyomi.source.model.Page import kotlinx.serialization.json.jsonArray import kotlinx.serialization.json.jsonPrimitive @@ -17,7 +17,7 @@ class RealmScans : WPMangaReader( ) { override val client: OkHttpClient = super.client.newBuilder() - .addInterceptor(RateLimitInterceptor(1, 1, TimeUnit.SECONDS)) + .rateLimit(1, 1, TimeUnit.SECONDS) .build() override fun pageListParse(document: Document): List { diff --git a/multisrc/overrides/wpmangareader/silencescan/src/SilenceScan.kt b/multisrc/overrides/wpmangareader/silencescan/src/SilenceScan.kt index 24bc1fad8..d4442ab6d 100644 --- a/multisrc/overrides/wpmangareader/silencescan/src/SilenceScan.kt +++ b/multisrc/overrides/wpmangareader/silencescan/src/SilenceScan.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.pt.silencescan -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.wpmangareader.WPMangaReader +import eu.kanade.tachiyomi.network.interceptor.rateLimit import eu.kanade.tachiyomi.source.model.SManga import okhttp3.OkHttpClient import java.text.SimpleDateFormat @@ -20,7 +20,7 @@ class SilenceScan : WPMangaReader( override val client: OkHttpClient = network.cloudflareClient.newBuilder() .connectTimeout(10, TimeUnit.SECONDS) .readTimeout(30, TimeUnit.SECONDS) - .addNetworkInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) + .rateLimit(1, 2, TimeUnit.SECONDS) .build() override val altName = "Nome alternativo: " diff --git a/multisrc/overrides/wpmangareader/tsundokutraducoes/src/TsundokuTraducoes.kt b/multisrc/overrides/wpmangareader/tsundokutraducoes/src/TsundokuTraducoes.kt index e2ceec359..260486674 100644 --- a/multisrc/overrides/wpmangareader/tsundokutraducoes/src/TsundokuTraducoes.kt +++ b/multisrc/overrides/wpmangareader/tsundokutraducoes/src/TsundokuTraducoes.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.pt.tsundokutraducoes -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.wpmangareader.WPMangaReader +import eu.kanade.tachiyomi.network.interceptor.rateLimit import okhttp3.OkHttpClient import java.text.SimpleDateFormat import java.util.Locale @@ -15,7 +15,7 @@ class TsundokuTraducoes : WPMangaReader( ) { override val client: OkHttpClient = network.cloudflareClient.newBuilder() - .addNetworkInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) + .rateLimit(1, 2, TimeUnit.SECONDS) .build() override val altName = "Nome alternativo: " diff --git a/multisrc/overrides/wpmangareader/yanpfansub/src/YANPFansub.kt b/multisrc/overrides/wpmangareader/yanpfansub/src/YANPFansub.kt index 199c38b85..88a3ca9b4 100644 --- a/multisrc/overrides/wpmangareader/yanpfansub/src/YANPFansub.kt +++ b/multisrc/overrides/wpmangareader/yanpfansub/src/YANPFansub.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.pt.yanpfansub -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.wpmangareader.WPMangaReader +import eu.kanade.tachiyomi.network.interceptor.rateLimit import okhttp3.OkHttpClient import java.text.SimpleDateFormat import java.util.Locale @@ -15,7 +15,7 @@ class YANPFansub : WPMangaReader( ) { override val client: OkHttpClient = network.cloudflareClient.newBuilder() - .addNetworkInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) + .rateLimit(1, 2, TimeUnit.SECONDS) .build() override val altName = "Nome alternativo: " diff --git a/multisrc/overrides/wpmangastream/asurascans/src/AsuraScans.kt b/multisrc/overrides/wpmangastream/asurascans/src/AsuraScans.kt index 8cb36fc92..dcd0c04e8 100644 --- a/multisrc/overrides/wpmangastream/asurascans/src/AsuraScans.kt +++ b/multisrc/overrides/wpmangastream/asurascans/src/AsuraScans.kt @@ -4,8 +4,8 @@ import android.app.Application import android.content.SharedPreferences import androidx.preference.PreferenceScreen import androidx.preference.SwitchPreferenceCompat -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.wpmangastream.WPMangaStream +import eu.kanade.tachiyomi.network.interceptor.rateLimit import eu.kanade.tachiyomi.source.ConfigurableSource import eu.kanade.tachiyomi.source.model.FilterList import eu.kanade.tachiyomi.source.model.MangasPage @@ -36,7 +36,7 @@ open class AsuraScans( override val client: OkHttpClient = network.cloudflareClient.newBuilder() .connectTimeout(10, TimeUnit.SECONDS) .readTimeout(30, TimeUnit.SECONDS) - .addInterceptor(RateLimitInterceptor(1, 3, TimeUnit.SECONDS)) + .rateLimit(1, 3, TimeUnit.SECONDS) .build() // Permanent Url for Manga/Chapter End diff --git a/multisrc/overrides/wpmangastream/boosei/src/Boosei.kt b/multisrc/overrides/wpmangastream/boosei/src/Boosei.kt index 6e65a5000..75a550927 100644 --- a/multisrc/overrides/wpmangastream/boosei/src/Boosei.kt +++ b/multisrc/overrides/wpmangastream/boosei/src/Boosei.kt @@ -1,17 +1,16 @@ package eu.kanade.tachiyomi.extension.id.boosei -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.wpmangastream.WPMangaStream +import eu.kanade.tachiyomi.network.interceptor.rateLimit import okhttp3.OkHttpClient import java.util.concurrent.TimeUnit class Boosei : WPMangaStream("Boosei", "https://boosei.com", "id") { - private val rateLimitInterceptor = RateLimitInterceptor(4) override val client: OkHttpClient = network.cloudflareClient.newBuilder() .connectTimeout(10, TimeUnit.SECONDS) .readTimeout(30, TimeUnit.SECONDS) - .addNetworkInterceptor(rateLimitInterceptor) + .rateLimit(4) .build() override val hasProjectPage = true diff --git a/multisrc/overrides/wpmangastream/default/additional.gradle.kts b/multisrc/overrides/wpmangastream/default/additional.gradle.kts deleted file mode 100644 index 10beb8157..000000000 --- a/multisrc/overrides/wpmangastream/default/additional.gradle.kts +++ /dev/null @@ -1,4 +0,0 @@ - -dependencies { - implementation project(':lib-ratelimit') -} diff --git a/multisrc/overrides/wpmangastream/imaginescan/src/ImagineScan.kt b/multisrc/overrides/wpmangastream/imaginescan/src/ImagineScan.kt index 787d7842f..c8fc4a9c1 100644 --- a/multisrc/overrides/wpmangastream/imaginescan/src/ImagineScan.kt +++ b/multisrc/overrides/wpmangastream/imaginescan/src/ImagineScan.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.pt.imaginescan -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.wpmangastream.WPMangaStream +import eu.kanade.tachiyomi.network.interceptor.rateLimit import okhttp3.OkHttpClient import java.text.SimpleDateFormat import java.util.Locale @@ -15,7 +15,7 @@ class ImagineScan : WPMangaStream( ) { override val client: OkHttpClient = super.client.newBuilder() - .addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) + .rateLimit(1, 2, TimeUnit.SECONDS) .build() override val altName: String = "Nome alternativo: " diff --git a/multisrc/overrides/wpmangastream/klankomik/src/KlanKomik.kt b/multisrc/overrides/wpmangastream/klankomik/src/KlanKomik.kt index 18b75a9a1..1743f75f5 100644 --- a/multisrc/overrides/wpmangastream/klankomik/src/KlanKomik.kt +++ b/multisrc/overrides/wpmangastream/klankomik/src/KlanKomik.kt @@ -1,17 +1,16 @@ package eu.kanade.tachiyomi.extension.id.klankomik -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.wpmangastream.WPMangaStream +import eu.kanade.tachiyomi.network.interceptor.rateLimit import okhttp3.OkHttpClient import java.util.concurrent.TimeUnit class KlanKomik : WPMangaStream("KlanKomik", "https://klankomik.com", "id") { - private val rateLimitInterceptor = RateLimitInterceptor(4) override val client: OkHttpClient = network.cloudflareClient.newBuilder() .connectTimeout(10, TimeUnit.SECONDS) .readTimeout(30, TimeUnit.SECONDS) - .addNetworkInterceptor(rateLimitInterceptor) + .rateLimit(4) .build() override val hasProjectPage = true diff --git a/multisrc/overrides/wpmangastream/komikav/src/KomikAV.kt b/multisrc/overrides/wpmangastream/komikav/src/KomikAV.kt index 8ad55d3c9..61c7dc985 100644 --- a/multisrc/overrides/wpmangastream/komikav/src/KomikAV.kt +++ b/multisrc/overrides/wpmangastream/komikav/src/KomikAV.kt @@ -1,8 +1,8 @@ package eu.kanade.tachiyomi.extension.id.komikav -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.wpmangastream.WPMangaStream import eu.kanade.tachiyomi.network.GET +import eu.kanade.tachiyomi.network.interceptor.rateLimit import eu.kanade.tachiyomi.source.model.Page import okhttp3.OkHttpClient import okhttp3.Request @@ -19,12 +19,10 @@ class KomikAV : WPMangaStream( // Formerly "Komik AV (WP Manga Stream)" override val id = 7875815514004535629 - private val rateLimitInterceptor = RateLimitInterceptor(4) - override val client: OkHttpClient = network.cloudflareClient.newBuilder() .connectTimeout(10, TimeUnit.SECONDS) .readTimeout(30, TimeUnit.SECONDS) - .addNetworkInterceptor(rateLimitInterceptor) + .rateLimit(4) .build() override fun imageRequest(page: Page): Request { diff --git a/multisrc/overrides/wpmangastream/komikcast/src/KomikCast.kt b/multisrc/overrides/wpmangastream/komikcast/src/KomikCast.kt index 889bf1aef..4c018239f 100644 --- a/multisrc/overrides/wpmangastream/komikcast/src/KomikCast.kt +++ b/multisrc/overrides/wpmangastream/komikcast/src/KomikCast.kt @@ -1,8 +1,8 @@ package eu.kanade.tachiyomi.extension.id.komikcast -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.wpmangastream.WPMangaStream import eu.kanade.tachiyomi.network.GET +import eu.kanade.tachiyomi.network.interceptor.rateLimit import eu.kanade.tachiyomi.source.model.Filter import eu.kanade.tachiyomi.source.model.FilterList import eu.kanade.tachiyomi.source.model.Page @@ -20,12 +20,10 @@ class KomikCast : WPMangaStream("Komik Cast", "https://komikcast.com", "id") { // Formerly "Komik Cast (WP Manga Stream)" override val id = 972717448578983812 - private val rateLimitInterceptor = RateLimitInterceptor(3) - override val client: OkHttpClient = network.cloudflareClient.newBuilder() .connectTimeout(10, TimeUnit.SECONDS) .readTimeout(30, TimeUnit.SECONDS) - .addNetworkInterceptor(rateLimitInterceptor) + .rateLimit(3) .build() override fun headersBuilder(): Headers.Builder = Headers.Builder() diff --git a/multisrc/overrides/wpmangastream/komikindoco/src/KomikindoCo.kt b/multisrc/overrides/wpmangastream/komikindoco/src/KomikindoCo.kt index 06fbe5f52..de477b2ed 100644 --- a/multisrc/overrides/wpmangastream/komikindoco/src/KomikindoCo.kt +++ b/multisrc/overrides/wpmangastream/komikindoco/src/KomikindoCo.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.id.komikindoco -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.wpmangastream.WPMangaStream +import eu.kanade.tachiyomi.network.interceptor.rateLimit import eu.kanade.tachiyomi.source.model.Page import eu.kanade.tachiyomi.source.model.SManga import kotlinx.serialization.json.Json @@ -18,12 +18,10 @@ class KomikindoCo : WPMangaStream("KomikIndo.co", "https://komikindo.co", "id", // Formerly "Komikindo.co" override val id = 734619124437406170 - private val rateLimitInterceptor = RateLimitInterceptor(4) - override val client: OkHttpClient = network.cloudflareClient.newBuilder() .connectTimeout(10, TimeUnit.SECONDS) .readTimeout(30, TimeUnit.SECONDS) - .addNetworkInterceptor(rateLimitInterceptor) + .rateLimit(4) .build() override val hasProjectPage = true diff --git a/multisrc/overrides/wpmangastream/komikstation/src/KomikStation.kt b/multisrc/overrides/wpmangastream/komikstation/src/KomikStation.kt index e9d47aa8e..0ae354eb6 100644 --- a/multisrc/overrides/wpmangastream/komikstation/src/KomikStation.kt +++ b/multisrc/overrides/wpmangastream/komikstation/src/KomikStation.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.id.komikstation -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.wpmangastream.WPMangaStream +import eu.kanade.tachiyomi.network.interceptor.rateLimit import eu.kanade.tachiyomi.source.model.Page import kotlinx.serialization.json.Json import kotlinx.serialization.json.jsonArray @@ -15,12 +15,10 @@ class KomikStation : WPMangaStream("Komik Station", "https://komikstation.co", " // Formerly "Komik Station (WP Manga Stream)" override val id = 6148605743576635261 - private val rateLimitInterceptor = RateLimitInterceptor(4) - override val client: OkHttpClient = network.cloudflareClient.newBuilder() .connectTimeout(10, TimeUnit.SECONDS) .readTimeout(30, TimeUnit.SECONDS) - .addNetworkInterceptor(rateLimitInterceptor) + .rateLimit(4) .build() private val json: Json by injectLazy() diff --git a/multisrc/overrides/wpmangastream/kumascans/src/KumaScans.kt b/multisrc/overrides/wpmangastream/kumascans/src/KumaScans.kt index 5f2fba959..985b1a75b 100644 --- a/multisrc/overrides/wpmangastream/kumascans/src/KumaScans.kt +++ b/multisrc/overrides/wpmangastream/kumascans/src/KumaScans.kt @@ -1,17 +1,16 @@ package eu.kanade.tachiyomi.extension.en.kumascans -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.wpmangastream.WPMangaStream +import eu.kanade.tachiyomi.network.interceptor.rateLimit import okhttp3.OkHttpClient import java.util.concurrent.TimeUnit class KumaScans : WPMangaStream("Kuma Scans (Kuma Translation)", "https://kumascans.com", "en") { - private val rateLimitInterceptor = RateLimitInterceptor(4) override val client: OkHttpClient = network.cloudflareClient.newBuilder() .connectTimeout(10, TimeUnit.SECONDS) .readTimeout(30, TimeUnit.SECONDS) - .addNetworkInterceptor(rateLimitInterceptor) + .rateLimit(4) .build() override val hasProjectPage = true diff --git a/multisrc/overrides/wpmangastream/mangakyo/src/Mangakyo.kt b/multisrc/overrides/wpmangastream/mangakyo/src/Mangakyo.kt index 154dd0bc9..1c75baf2a 100644 --- a/multisrc/overrides/wpmangastream/mangakyo/src/Mangakyo.kt +++ b/multisrc/overrides/wpmangastream/mangakyo/src/Mangakyo.kt @@ -1,16 +1,15 @@ package eu.kanade.tachiyomi.extension.id.mangakyo -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.wpmangastream.WPMangaStream +import eu.kanade.tachiyomi.network.interceptor.rateLimit import okhttp3.OkHttpClient import java.util.concurrent.TimeUnit class Mangakyo : WPMangaStream("Mangakyo", "https://www.mangakyo.me", "id") { - private val rateLimitInterceptor = RateLimitInterceptor(4) override val client: OkHttpClient = network.cloudflareClient.newBuilder() .connectTimeout(10, TimeUnit.SECONDS) .readTimeout(30, TimeUnit.SECONDS) - .addNetworkInterceptor(rateLimitInterceptor) + .rateLimit(4) .build() } diff --git a/multisrc/overrides/wpmangastream/mangaproz/src/MangaPro.kt b/multisrc/overrides/wpmangastream/mangaproz/src/MangaPro.kt index d7b08bfcf..20bf0a7f5 100644 --- a/multisrc/overrides/wpmangastream/mangaproz/src/MangaPro.kt +++ b/multisrc/overrides/wpmangastream/mangaproz/src/MangaPro.kt @@ -1,21 +1,16 @@ package eu.kanade.tachiyomi.extension.ar.mangaproz -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.wpmangastream.WPMangaStream -import eu.kanade.tachiyomi.source.model.SChapter +import eu.kanade.tachiyomi.network.interceptor.rateLimit import okhttp3.OkHttpClient -import org.jsoup.nodes.Element import java.util.concurrent.TimeUnit class MangaPro : WPMangaStream("Manga Pro", "https://mangaprotm.com", "ar") { override val id: Long = 964048798769065340 - private val rateLimitInterceptor = RateLimitInterceptor(4) - override val client: OkHttpClient = network.cloudflareClient.newBuilder() .connectTimeout(10, TimeUnit.SECONDS) .readTimeout(30, TimeUnit.SECONDS) - .addNetworkInterceptor(rateLimitInterceptor) + .rateLimit(4) .build() - } diff --git a/multisrc/overrides/wpmangastream/mangaraworg/src/MangaRawOrg.kt b/multisrc/overrides/wpmangastream/mangaraworg/src/MangaRawOrg.kt index e71570aeb..6d6c0b776 100644 --- a/multisrc/overrides/wpmangastream/mangaraworg/src/MangaRawOrg.kt +++ b/multisrc/overrides/wpmangastream/mangaraworg/src/MangaRawOrg.kt @@ -1,9 +1,9 @@ package eu.kanade.tachiyomi.extension.ja.mangaraworg -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.wpmangastream.WPMangaStream import eu.kanade.tachiyomi.network.GET import eu.kanade.tachiyomi.network.asObservableSuccess +import eu.kanade.tachiyomi.network.interceptor.rateLimit import eu.kanade.tachiyomi.source.model.FilterList import eu.kanade.tachiyomi.source.model.Page import eu.kanade.tachiyomi.source.model.SChapter @@ -21,12 +21,10 @@ class MangaRawOrg : WPMangaStream("Manga Raw.org", "https://mangaraw.org", "ja") // Formerly "Manga Raw" from WPMangaStream override val id = 6223520752496636410 - private val rateLimitInterceptor = RateLimitInterceptor(4) - override val client: OkHttpClient = network.cloudflareClient.newBuilder() .connectTimeout(10, TimeUnit.SECONDS) .readTimeout(30, TimeUnit.SECONDS) - .addNetworkInterceptor(rateLimitInterceptor) + .rateLimit(4) .build() override fun popularMangaRequest(page: Int): Request = GET("$baseUrl/search?order=popular&page=$page", headers) diff --git a/multisrc/overrides/wpmangastream/mangceh/src/Mareceh.kt b/multisrc/overrides/wpmangastream/mangceh/src/Mareceh.kt index 56719f1fa..73c554d79 100644 --- a/multisrc/overrides/wpmangastream/mangceh/src/Mareceh.kt +++ b/multisrc/overrides/wpmangastream/mangceh/src/Mareceh.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.id.mangceh -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.wpmangastream.WPMangaStream +import eu.kanade.tachiyomi.network.interceptor.rateLimit import okhttp3.OkHttpClient import java.util.concurrent.TimeUnit @@ -9,12 +9,10 @@ class Mareceh : WPMangaStream("Mareceh", "https://mareceh.com", "id") { override val versionId = 2 - private val rateLimitInterceptor = RateLimitInterceptor(4) - override val client: OkHttpClient = network.cloudflareClient.newBuilder() .connectTimeout(10, TimeUnit.SECONDS) .readTimeout(30, TimeUnit.SECONDS) - .addNetworkInterceptor(rateLimitInterceptor) + .rateLimit(4) .build() override val hasProjectPage = true diff --git a/multisrc/overrides/wpmangastream/masterkomik/src/MasterKomik.kt b/multisrc/overrides/wpmangastream/masterkomik/src/MasterKomik.kt index ddf8d757b..98f94a82a 100644 --- a/multisrc/overrides/wpmangastream/masterkomik/src/MasterKomik.kt +++ b/multisrc/overrides/wpmangastream/masterkomik/src/MasterKomik.kt @@ -1,17 +1,16 @@ package eu.kanade.tachiyomi.extension.id.masterkomik -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.wpmangastream.WPMangaStream +import eu.kanade.tachiyomi.network.interceptor.rateLimit import okhttp3.OkHttpClient import java.util.concurrent.TimeUnit class MasterKomik : WPMangaStream("MasterKomik", "https://masterkomik.com", "id") { - private val rateLimitInterceptor = RateLimitInterceptor(4) override val client: OkHttpClient = network.cloudflareClient.newBuilder() .connectTimeout(10, TimeUnit.SECONDS) .readTimeout(30, TimeUnit.SECONDS) - .addNetworkInterceptor(rateLimitInterceptor) + .rateLimit(4) .build() override val projectPageString = "/project-list" diff --git a/multisrc/overrides/wpmangastream/nonstopscans/src/NonStopScans.kt b/multisrc/overrides/wpmangastream/nonstopscans/src/NonStopScans.kt index 7aa99a2d0..39d43335b 100644 --- a/multisrc/overrides/wpmangastream/nonstopscans/src/NonStopScans.kt +++ b/multisrc/overrides/wpmangastream/nonstopscans/src/NonStopScans.kt @@ -1,16 +1,15 @@ package eu.kanade.tachiyomi.extension.en.nonstopscans -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.wpmangastream.WPMangaStream +import eu.kanade.tachiyomi.network.interceptor.rateLimit import okhttp3.OkHttpClient import java.util.concurrent.TimeUnit class NonStopScans : WPMangaStream("Non-Stop Scans", "https://www.nonstopscans.com", "en") { - private val rateLimitInterceptor = RateLimitInterceptor(4) override val client: OkHttpClient = network.cloudflareClient.newBuilder() .connectTimeout(10, TimeUnit.SECONDS) .readTimeout(30, TimeUnit.SECONDS) - .addNetworkInterceptor(rateLimitInterceptor) + .rateLimit(4) .build() } diff --git a/multisrc/overrides/wpmangastream/rawkuma/src/Rawkuma.kt b/multisrc/overrides/wpmangastream/rawkuma/src/Rawkuma.kt index 7f004f902..25d4b8f73 100644 --- a/multisrc/overrides/wpmangastream/rawkuma/src/Rawkuma.kt +++ b/multisrc/overrides/wpmangastream/rawkuma/src/Rawkuma.kt @@ -1,16 +1,15 @@ package eu.kanade.tachiyomi.extension.ja.rawkuma -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.wpmangastream.WPMangaStream +import eu.kanade.tachiyomi.network.interceptor.rateLimit import okhttp3.OkHttpClient import java.util.concurrent.TimeUnit class Rawkuma : WPMangaStream("Rawkuma", "https://rawkuma.com/", "ja") { - private val rateLimitInterceptor = RateLimitInterceptor(4) override val client: OkHttpClient = network.cloudflareClient.newBuilder() .connectTimeout(10, TimeUnit.SECONDS) .readTimeout(30, TimeUnit.SECONDS) - .addNetworkInterceptor(rateLimitInterceptor) + .rateLimit(4) .build() } diff --git a/multisrc/overrides/wpmangastream/readkomik/src/ReadKomik.kt b/multisrc/overrides/wpmangastream/readkomik/src/ReadKomik.kt index 2fda1be3a..c7a2b6963 100644 --- a/multisrc/overrides/wpmangastream/readkomik/src/ReadKomik.kt +++ b/multisrc/overrides/wpmangastream/readkomik/src/ReadKomik.kt @@ -1,17 +1,16 @@ package eu.kanade.tachiyomi.extension.en.readkomik -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.wpmangastream.WPMangaStream +import eu.kanade.tachiyomi.network.interceptor.rateLimit import okhttp3.OkHttpClient import java.util.concurrent.TimeUnit class ReadKomik : WPMangaStream("Readkomik", "https://readkomik.com", "en") { - private val rateLimitInterceptor = RateLimitInterceptor(4) override val client: OkHttpClient = network.cloudflareClient.newBuilder() .connectTimeout(10, TimeUnit.SECONDS) .readTimeout(30, TimeUnit.SECONDS) - .addNetworkInterceptor(rateLimitInterceptor) + .rateLimit(4) .build() override val hasProjectPage = true diff --git a/multisrc/overrides/wpmangastream/sektedoujin/src/SekteDoujin.kt b/multisrc/overrides/wpmangastream/sektedoujin/src/SekteDoujin.kt index eee5b2d37..f7d36b154 100644 --- a/multisrc/overrides/wpmangastream/sektedoujin/src/SekteDoujin.kt +++ b/multisrc/overrides/wpmangastream/sektedoujin/src/SekteDoujin.kt @@ -1,18 +1,17 @@ package eu.kanade.tachiyomi.extension.id.sektedoujin -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.wpmangastream.WPMangaStream +import eu.kanade.tachiyomi.network.interceptor.rateLimit import okhttp3.OkHttpClient import java.text.SimpleDateFormat import java.util.Locale import java.util.concurrent.TimeUnit class SekteDoujin : WPMangaStream("Sekte Doujin", "https://sektedoujin.club", "id", SimpleDateFormat("MMMM dd, yyyy", Locale.forLanguageTag("id"))) { - private val rateLimitInterceptor = RateLimitInterceptor(4) override val client: OkHttpClient = network.cloudflareClient.newBuilder() .connectTimeout(10, TimeUnit.SECONDS) .readTimeout(30, TimeUnit.SECONDS) - .addNetworkInterceptor(rateLimitInterceptor) + .rateLimit(4) .build() } diff --git a/multisrc/overrides/wpmangastream/sektekomik/src/SekteKomik.kt b/multisrc/overrides/wpmangastream/sektekomik/src/SekteKomik.kt index fa989681d..fd191b8b9 100644 --- a/multisrc/overrides/wpmangastream/sektekomik/src/SekteKomik.kt +++ b/multisrc/overrides/wpmangastream/sektekomik/src/SekteKomik.kt @@ -1,8 +1,8 @@ package eu.kanade.tachiyomi.extension.id.sektekomik -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.wpmangastream.WPMangaStream import eu.kanade.tachiyomi.network.GET +import eu.kanade.tachiyomi.network.interceptor.rateLimit import eu.kanade.tachiyomi.source.model.Page import okhttp3.Headers import okhttp3.OkHttpClient @@ -13,12 +13,10 @@ class SekteKomik : WPMangaStream("Sekte Komik", "https://sektekomik.com", "id") // Formerly "Sekte Komik (WP Manga Stream)" override val id = 7866629035053218469 - private val rateLimitInterceptor = RateLimitInterceptor(4) - override val client: OkHttpClient = network.cloudflareClient.newBuilder() .connectTimeout(10, TimeUnit.SECONDS) .readTimeout(30, TimeUnit.SECONDS) - .addNetworkInterceptor(rateLimitInterceptor) + .rateLimit(4) .build() override fun headersBuilder(): Headers.Builder = Headers.Builder() diff --git a/multisrc/overrides/wpmangastream/sheamanga/src/SheaManga.kt b/multisrc/overrides/wpmangastream/sheamanga/src/SheaManga.kt index 69e686fe6..c43b73e75 100644 --- a/multisrc/overrides/wpmangastream/sheamanga/src/SheaManga.kt +++ b/multisrc/overrides/wpmangastream/sheamanga/src/SheaManga.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.id.sheamanga -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.wpmangastream.WPMangaStream +import eu.kanade.tachiyomi.network.interceptor.rateLimit import okhttp3.Dns import okhttp3.OkHttpClient import java.text.SimpleDateFormat @@ -14,12 +14,11 @@ class SheaManga : WPMangaStream( "id", dateFormat = SimpleDateFormat("MMMM dd, yyyy", Locale.forLanguageTag("id")) ) { - private val rateLimitInterceptor = RateLimitInterceptor(4) override val client: OkHttpClient = network.cloudflareClient.newBuilder() .connectTimeout(10, TimeUnit.SECONDS) .readTimeout(30, TimeUnit.SECONDS) - .addNetworkInterceptor(rateLimitInterceptor) + .rateLimit(4) .dns(Dns.SYSTEM) .build() diff --git a/multisrc/overrides/wpmangastream/tempestmanga/src/TempestManga.kt b/multisrc/overrides/wpmangastream/tempestmanga/src/TempestManga.kt index f5e273944..3c79e3398 100644 --- a/multisrc/overrides/wpmangastream/tempestmanga/src/TempestManga.kt +++ b/multisrc/overrides/wpmangastream/tempestmanga/src/TempestManga.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.tr.tempestmanga -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.wpmangastream.WPMangaStream +import eu.kanade.tachiyomi.network.interceptor.rateLimit import okhttp3.OkHttpClient import java.text.SimpleDateFormat import java.util.Locale @@ -11,11 +11,10 @@ class TempestManga : WPMangaStream( "Tempest Manga", "https://manga.tempestfansub.com", "tr", SimpleDateFormat("MMMM dd, yyyy", Locale("tr")) ) { - private val rateLimitInterceptor = RateLimitInterceptor(4) override val client: OkHttpClient = network.cloudflareClient.newBuilder() .connectTimeout(10, TimeUnit.SECONDS) .readTimeout(30, TimeUnit.SECONDS) - .addNetworkInterceptor(rateLimitInterceptor) + .rateLimit(4) .build() } diff --git a/multisrc/overrides/wpmangastream/westmanga/src/WestManga.kt b/multisrc/overrides/wpmangastream/westmanga/src/WestManga.kt index ebca0beed..32c7999c6 100644 --- a/multisrc/overrides/wpmangastream/westmanga/src/WestManga.kt +++ b/multisrc/overrides/wpmangastream/westmanga/src/WestManga.kt @@ -1,7 +1,7 @@ package eu.kanade.tachiyomi.extension.id.westmanga -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.wpmangastream.WPMangaStream +import eu.kanade.tachiyomi.network.interceptor.rateLimit import eu.kanade.tachiyomi.source.model.SManga import okhttp3.OkHttpClient import org.jsoup.nodes.Document @@ -11,12 +11,10 @@ class WestManga : WPMangaStream("West Manga", "https://westmanga.info", "id") { // Formerly "West Manga (WP Manga Stream)" override val id = 8883916630998758688 - private val rateLimitInterceptor = RateLimitInterceptor(4) - override val client: OkHttpClient = network.cloudflareClient.newBuilder() .connectTimeout(10, TimeUnit.SECONDS) .readTimeout(30, TimeUnit.SECONDS) - .addNetworkInterceptor(rateLimitInterceptor) + .rateLimit(4) .build() override fun mangaDetailsParse(document: Document): SManga { diff --git a/multisrc/overrides/wpmangastream/xcalibrscans/src/xCaliBRScans.kt b/multisrc/overrides/wpmangastream/xcalibrscans/src/xCaliBRScans.kt index d9f6f43bb..0552ae929 100644 --- a/multisrc/overrides/wpmangastream/xcalibrscans/src/xCaliBRScans.kt +++ b/multisrc/overrides/wpmangastream/xcalibrscans/src/xCaliBRScans.kt @@ -4,8 +4,8 @@ import eu.kanade.tachiyomi.extension.en.xcalibrscans.interceptor.MirrorImageInte import eu.kanade.tachiyomi.extension.en.xcalibrscans.interceptor.SplittedImageInterceptor import eu.kanade.tachiyomi.extension.en.xcalibrscans.interceptor.prepareMirrorImageForInterceptor import eu.kanade.tachiyomi.extension.en.xcalibrscans.interceptor.prepareSplittedImageForInterceptor -import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor import eu.kanade.tachiyomi.multisrc.wpmangastream.WPMangaStream +import eu.kanade.tachiyomi.network.interceptor.rateLimit import eu.kanade.tachiyomi.source.model.Page import kotlinx.serialization.json.Json import kotlinx.serialization.json.jsonArray @@ -22,7 +22,7 @@ class xCaliBRScans : WPMangaStream("xCaliBR Scans", "https://xcalibrscans.com", override val client: OkHttpClient = network.cloudflareClient.newBuilder() .connectTimeout(10, TimeUnit.SECONDS) .readTimeout(30, TimeUnit.SECONDS) - .addNetworkInterceptor(RateLimitInterceptor(2)) + .rateLimit(2) .addNetworkInterceptor(SplittedImageInterceptor()) .addNetworkInterceptor(MirrorImageInterceptor()) .build() diff --git a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/bilibili/BilibiliGenerator.kt b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/bilibili/BilibiliGenerator.kt index 4874bb610..49b1f5c4d 100644 --- a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/bilibili/BilibiliGenerator.kt +++ b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/bilibili/BilibiliGenerator.kt @@ -10,7 +10,7 @@ class BilibiliGenerator : ThemeSourceGenerator { override val themeClass = "Bilibili" - override val baseVersionCode: Int = 2 + override val baseVersionCode: Int = 3 override val sources = listOf( MultiLang("BILIBILI COMICS", "https://www.bilibilicomics.com", listOf("en", "zh-Hans", "id"), className = "BilibiliComicsFactory"), diff --git a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/foolslide/FoolSlideGenerator.kt b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/foolslide/FoolSlideGenerator.kt index 7e4df7638..7f51fe2fc 100644 --- a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/foolslide/FoolSlideGenerator.kt +++ b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/foolslide/FoolSlideGenerator.kt @@ -31,7 +31,7 @@ class FoolSlideGenerator : ThemeSourceGenerator { SingleLang("Yuri-ism", "https://www.yuri-ism.net", "en", className = "YuriIsm"), SingleLang("Zandy no Fansub", "https://zandynofansub.aishiteru.org", "en"), SingleLang("Kirishima Fansub", "https://www.kirishimafansub.net", "es"), - SingleLang("Baixar Hentai", "https://leitura.baixarhentai.net", "pt-BR", isNsfw = true, overrideVersionCode = 3), + SingleLang("Baixar Hentai", "https://leitura.baixarhentai.net", "pt-BR", isNsfw = true, overrideVersionCode = 4), MultiLang("HNI-Scantrad", "https://hni-scantrad.com", listOf("fr", "en"), className = "HNIScantradFactory", pkgName = "hniscantrad", overrideVersionCode = 1), SingleLang("QuegnaReader", "http://pignaquegna.altervista.org", "it", overrideVersionCode = 1), SingleLang("NIFTeam", "http://read-nifteam.info", "it"), diff --git a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/gattsu/GattsuGenerator.kt b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/gattsu/GattsuGenerator.kt index 08f538f32..fe7e43de4 100644 --- a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/gattsu/GattsuGenerator.kt +++ b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/gattsu/GattsuGenerator.kt @@ -9,7 +9,7 @@ class GattsuGenerator : ThemeSourceGenerator { override val themeClass = "Gattsu" - override val baseVersionCode: Int = 3 + override val baseVersionCode: Int = 4 override val sources = listOf( SingleLang("Hentai Season", "https://hentaiseason.com", "pt-BR", isNsfw = true), diff --git a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/madara/MadaraGenerator.kt b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/madara/MadaraGenerator.kt index a0440056b..6c24f1b34 100644 --- a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/madara/MadaraGenerator.kt +++ b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/madara/MadaraGenerator.kt @@ -10,7 +10,7 @@ class MadaraGenerator : ThemeSourceGenerator { override val themeClass = "Madara" - override val baseVersionCode: Int = 20 + override val baseVersionCode: Int = 21 override val sources = listOf( MultiLang("Leviatan Scans", "https://leviatanscans.com", listOf("en", "es"), className = "LeviatanScansFactory", overrideVersionCode = 9), diff --git a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/madtheme/MadThemeGenerator.kt b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/madtheme/MadThemeGenerator.kt index 7a96138e2..f454e8030 100644 --- a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/madtheme/MadThemeGenerator.kt +++ b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/madtheme/MadThemeGenerator.kt @@ -9,7 +9,7 @@ class MadThemeGenerator : ThemeSourceGenerator { override val themeClass = "MadTheme" - override val baseVersionCode: Int = 5 + override val baseVersionCode: Int = 6 override val sources = listOf( SingleLang("BeeHentai", "https://beehentai.com", "en", isNsfw = true), diff --git a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/mangahub/MangaHubGenerator.kt b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/mangahub/MangaHubGenerator.kt index 79794317f..9739e8a42 100644 --- a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/mangahub/MangaHubGenerator.kt +++ b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/mangahub/MangaHubGenerator.kt @@ -9,7 +9,7 @@ class MangaHubGenerator : ThemeSourceGenerator { override val themeClass = "MangaHub" - override val baseVersionCode: Int = 2 + override val baseVersionCode: Int = 3 override val sources = listOf( SingleLang("1Manga.co", "https://1manga.co", "en", isNsfw = true, className = "OneMangaCo"), diff --git a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/mangasar/MangaSarGenerator.kt b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/mangasar/MangaSarGenerator.kt index ae933db5b..0cffd58ad 100644 --- a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/mangasar/MangaSarGenerator.kt +++ b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/mangasar/MangaSarGenerator.kt @@ -9,7 +9,7 @@ class MangaSarGenerator : ThemeSourceGenerator { override val themeClass = "MangaSar" - override val baseVersionCode: Int = 5 + override val baseVersionCode: Int = 6 override val sources = listOf( SingleLang("MangaTube", "https://mangatube.site", "pt-BR"), diff --git a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/nepnep/NepNepGenerator.kt b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/nepnep/NepNepGenerator.kt index 53b798902..8844875ed 100644 --- a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/nepnep/NepNepGenerator.kt +++ b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/nepnep/NepNepGenerator.kt @@ -9,7 +9,7 @@ class NepNepGenerator : ThemeSourceGenerator { override val themeClass = "NepNep" - override val baseVersionCode: Int = 7 + override val baseVersionCode: Int = 8 override val sources = listOf( SingleLang("MangaSee", "https://mangasee123.com", "en", overrideVersionCode = 20), diff --git a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/wpmangareader/WPMangaReaderGenerator.kt b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/wpmangareader/WPMangaReaderGenerator.kt index 94c3f2289..77dd47c8b 100644 --- a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/wpmangareader/WPMangaReaderGenerator.kt +++ b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/wpmangareader/WPMangaReaderGenerator.kt @@ -10,7 +10,7 @@ class WPMangaReaderGenerator : ThemeSourceGenerator { override val themeClass = "WPMangaReader" - override val baseVersionCode: Int = 12 + override val baseVersionCode: Int = 13 override val sources = listOf( MultiLang("Flame Scans", "https://flamescans.org", listOf("ar", "en"), className = "FlameScansFactory", pkgName = "flamescans", overrideVersionCode = 1), diff --git a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/wpmangastream/WPMangaStreamGenerator.kt b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/wpmangastream/WPMangaStreamGenerator.kt index 8c034565c..e914175e3 100644 --- a/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/wpmangastream/WPMangaStreamGenerator.kt +++ b/multisrc/src/main/java/eu/kanade/tachiyomi/multisrc/wpmangastream/WPMangaStreamGenerator.kt @@ -10,7 +10,7 @@ class WPMangaStreamGenerator : ThemeSourceGenerator { override val themeClass = "WPMangaStream" - override val baseVersionCode: Int = 14 + override val baseVersionCode: Int = 15 override val sources = listOf( MultiLang("Asura Scans", "https://www.asurascans.com", listOf("en", "tr"), className = "AsuraScansFactory", pkgName = "asurascans", overrideVersionCode = 13), diff --git a/settings.gradle.kts b/settings.gradle.kts index b09f644d5..8cef3db0d 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,8 +1,5 @@ include(":core") -include(":lib-ratelimit") -project(":lib-ratelimit").projectDir = File("lib/ratelimit") - include(":lib-dataimage") project(":lib-dataimage").projectDir = File("lib/dataimage")