Refactor to use app-provided rate limiting interceptors (#12089)

This commit is contained in:
arkon 2022-06-05 17:51:18 -04:00 committed by GitHub
parent 93e6774da0
commit 1905256b08
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
191 changed files with 769 additions and 1216 deletions

View File

@ -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)
}

View File

@ -1,3 +0,0 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="eu.kanade.tachiyomi.lib.ratelimit">
</manifest>

View File

@ -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<Long>(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())
}
}

View File

@ -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<Long>(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())
}
}

View File

@ -1,6 +1,5 @@
package eu.kanade.tachiyomi.extension.all.bilibilicomics 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.Bilibili
import eu.kanade.tachiyomi.multisrc.bilibili.BilibiliAccessToken import eu.kanade.tachiyomi.multisrc.bilibili.BilibiliAccessToken
import eu.kanade.tachiyomi.multisrc.bilibili.BilibiliAccessTokenCookie 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.BilibiliUnlockedEpisode
import eu.kanade.tachiyomi.multisrc.bilibili.BilibiliUserEpisodes import eu.kanade.tachiyomi.multisrc.bilibili.BilibiliUserEpisodes
import eu.kanade.tachiyomi.network.POST import eu.kanade.tachiyomi.network.POST
import eu.kanade.tachiyomi.network.interceptor.rateLimitHost
import eu.kanade.tachiyomi.source.SourceFactory import eu.kanade.tachiyomi.source.SourceFactory
import eu.kanade.tachiyomi.source.model.Page import eu.kanade.tachiyomi.source.model.Page
import eu.kanade.tachiyomi.source.model.SChapter import eu.kanade.tachiyomi.source.model.SChapter
@ -46,9 +46,9 @@ abstract class BilibiliComics(lang: String) : Bilibili(
override val client: OkHttpClient = super.client.newBuilder() override val client: OkHttpClient = super.client.newBuilder()
.addInterceptor(::signedInIntercept) .addInterceptor(::signedInIntercept)
.addInterceptor(::expiredTokenIntercept) .addInterceptor(::expiredTokenIntercept)
.addInterceptor(SpecificHostRateLimitInterceptor(baseUrl.toHttpUrl(), 1)) .rateLimitHost(baseUrl.toHttpUrl(), 1)
.addInterceptor(SpecificHostRateLimitInterceptor(CDN_URL.toHttpUrl(), 2)) .rateLimitHost(CDN_URL.toHttpUrl(), 2)
.addInterceptor(SpecificHostRateLimitInterceptor(COVER_CDN_URL.toHttpUrl(), 2)) .rateLimitHost(COVER_CDN_URL.toHttpUrl(), 2)
.build() .build()
override val signedIn: Boolean override val signedIn: Boolean

View File

@ -1,10 +1,10 @@
package eu.kanade.tachiyomi.extension.zh.bilibilimanga 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.Bilibili
import eu.kanade.tachiyomi.multisrc.bilibili.BilibiliComicDto import eu.kanade.tachiyomi.multisrc.bilibili.BilibiliComicDto
import eu.kanade.tachiyomi.multisrc.bilibili.BilibiliIntl import eu.kanade.tachiyomi.multisrc.bilibili.BilibiliIntl
import eu.kanade.tachiyomi.multisrc.bilibili.BilibiliTag import eu.kanade.tachiyomi.multisrc.bilibili.BilibiliTag
import eu.kanade.tachiyomi.network.interceptor.rateLimitHost
import eu.kanade.tachiyomi.source.model.SChapter import eu.kanade.tachiyomi.source.model.SChapter
import okhttp3.Headers import okhttp3.Headers
import okhttp3.HttpUrl.Companion.toHttpUrl import okhttp3.HttpUrl.Companion.toHttpUrl
@ -21,9 +21,9 @@ class BilibiliManga : Bilibili(
override val client: OkHttpClient = super.client.newBuilder() override val client: OkHttpClient = super.client.newBuilder()
.addInterceptor(::expiredTokenIntercept) .addInterceptor(::expiredTokenIntercept)
.addInterceptor(SpecificHostRateLimitInterceptor(baseUrl.toHttpUrl(), 1)) .rateLimitHost(baseUrl.toHttpUrl(), 1)
.addInterceptor(SpecificHostRateLimitInterceptor(CDN_URL.toHttpUrl(), 2)) .rateLimitHost(CDN_URL.toHttpUrl(), 2)
.addInterceptor(SpecificHostRateLimitInterceptor(COVER_CDN_URL.toHttpUrl(), 2)) .rateLimitHost(COVER_CDN_URL.toHttpUrl(), 2)
.build() .build()
override fun headersBuilder() = Headers.Builder().apply { override fun headersBuilder() = Headers.Builder().apply {

View File

@ -1,4 +0,0 @@
dependencies {
implementation project(':lib-ratelimit')
}

View File

@ -1,8 +1,8 @@
package eu.kanade.tachiyomi.extension.pt.baixarhentai package eu.kanade.tachiyomi.extension.pt.baixarhentai
import androidx.preference.PreferenceScreen import androidx.preference.PreferenceScreen
import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor
import eu.kanade.tachiyomi.multisrc.foolslide.FoolSlide import eu.kanade.tachiyomi.multisrc.foolslide.FoolSlide
import eu.kanade.tachiyomi.network.interceptor.rateLimit
import eu.kanade.tachiyomi.source.model.SManga import eu.kanade.tachiyomi.source.model.SManga
import org.jsoup.nodes.Document import org.jsoup.nodes.Document
import java.util.concurrent.TimeUnit import java.util.concurrent.TimeUnit
@ -12,7 +12,7 @@ class BaixarHentai : FoolSlide("Baixar Hentai", "https://leitura.baixarhentai.ne
override val id = 8908032188831949972 override val id = 8908032188831949972
override val client = super.client.newBuilder() override val client = super.client.newBuilder()
.addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) .rateLimit(1, 2, TimeUnit.SECONDS)
.build() .build()
override fun mangaDetailsParse(document: Document) = SManga.create().apply { override fun mangaDetailsParse(document: Document) = SManga.create().apply {

View File

@ -1,4 +0,0 @@
dependencies {
implementation project(':lib-ratelimit')
}

View File

@ -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()
}

View File

@ -1,4 +0,0 @@
dependencies {
implementation project(':lib-ratelimit')
}

View File

@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.extension.pt.hentaiseason 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.multisrc.gattsu.Gattsu
import eu.kanade.tachiyomi.network.interceptor.rateLimit
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import java.util.concurrent.TimeUnit import java.util.concurrent.TimeUnit
@ -12,6 +12,6 @@ class HentaiSeason : Gattsu(
) { ) {
override val client: OkHttpClient = super.client.newBuilder() override val client: OkHttpClient = super.client.newBuilder()
.addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) .rateLimit(1, 2, TimeUnit.SECONDS)
.build() .build()
} }

View File

@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.extension.pt.hentaitokyo 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.multisrc.gattsu.Gattsu
import eu.kanade.tachiyomi.network.interceptor.rateLimit
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import java.util.concurrent.TimeUnit import java.util.concurrent.TimeUnit
@ -12,6 +12,6 @@ class HentaiTokyo : Gattsu(
) { ) {
override val client: OkHttpClient = super.client.newBuilder() override val client: OkHttpClient = super.client.newBuilder()
.addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) .rateLimit(1, 2, TimeUnit.SECONDS)
.build() .build()
} }

View File

@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.extension.pt.universohentai 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.multisrc.gattsu.Gattsu
import eu.kanade.tachiyomi.network.interceptor.rateLimit
import eu.kanade.tachiyomi.source.model.SChapter import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.util.asJsoup import eu.kanade.tachiyomi.util.asJsoup
@ -18,7 +18,7 @@ class UniversoHentai : Gattsu(
) { ) {
override val client: OkHttpClient = super.client.newBuilder() override val client: OkHttpClient = super.client.newBuilder()
.addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) .rateLimit(1, 2, TimeUnit.SECONDS)
.build() .build()
override fun latestUpdatesSelector() = "div.meio div.videos div.video a[href^=$baseUrl]:not(:has(span.selo-hd))" override fun latestUpdatesSelector() = "div.meio div.videos div.video a[href^=$baseUrl]:not(:has(span.selo-hd))"

View File

@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.extension.pt.aiinscan 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.multisrc.madara.Madara
import eu.kanade.tachiyomi.network.interceptor.rateLimit
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.Locale import java.util.Locale
@ -15,7 +15,7 @@ class AiinScan : Madara(
) { ) {
override val client: OkHttpClient = super.client.newBuilder() override val client: OkHttpClient = super.client.newBuilder()
.addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) .rateLimit(1, 2, TimeUnit.SECONDS)
.build() .build()
override val useNewChapterEndpoint: Boolean = true override val useNewChapterEndpoint: Boolean = true

View File

@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.extension.pt.akumanotenshi 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.multisrc.madara.Madara
import eu.kanade.tachiyomi.network.interceptor.rateLimit
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.Locale import java.util.Locale
@ -15,6 +15,6 @@ class AkumaNoTenshi : Madara(
) { ) {
override val client: OkHttpClient = super.client.newBuilder() override val client: OkHttpClient = super.client.newBuilder()
.addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) .rateLimit(1, 2, TimeUnit.SECONDS)
.build() .build()
} }

View File

@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.extension.pt.animecenterscan 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.multisrc.madara.Madara
import eu.kanade.tachiyomi.network.interceptor.rateLimit
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.Locale import java.util.Locale
@ -15,6 +15,6 @@ class AnimeCenterScan : Madara(
) { ) {
override val client: OkHttpClient = super.client.newBuilder() override val client: OkHttpClient = super.client.newBuilder()
.addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) .rateLimit(1, 2, TimeUnit.SECONDS)
.build() .build()
} }

View File

@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.extension.pt.arthurscan 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.multisrc.madara.Madara
import eu.kanade.tachiyomi.network.interceptor.rateLimit
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.Locale import java.util.Locale
@ -15,7 +15,7 @@ class ArthurScan : Madara(
) { ) {
override val client: OkHttpClient = super.client.newBuilder() override val client: OkHttpClient = super.client.newBuilder()
.addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) .rateLimit(1, 2, TimeUnit.SECONDS)
.build() .build()
override val useNewChapterEndpoint = true override val useNewChapterEndpoint = true

View File

@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.extension.pt.bananamecanica 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.multisrc.madara.Madara
import eu.kanade.tachiyomi.network.interceptor.rateLimit
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.Locale import java.util.Locale
@ -18,6 +18,6 @@ class BananaCitrica : Madara(
override val id: Long = 4770070980248873010 override val id: Long = 4770070980248873010
override val client: OkHttpClient = super.client.newBuilder() override val client: OkHttpClient = super.client.newBuilder()
.addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) .rateLimit(1, 2, TimeUnit.SECONDS)
.build() .build()
} }

View File

@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.extension.pt.blmanhwaclub 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.multisrc.madara.Madara
import eu.kanade.tachiyomi.network.interceptor.rateLimit
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.Locale import java.util.Locale
@ -15,6 +15,6 @@ class BlManhwaClub : Madara(
) { ) {
override val client: OkHttpClient = super.client.newBuilder() override val client: OkHttpClient = super.client.newBuilder()
.addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) .rateLimit(1, 2, TimeUnit.SECONDS)
.build() .build()
} }

View File

@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.extension.pt.borutoexplorer 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.multisrc.madara.Madara
import eu.kanade.tachiyomi.network.interceptor.rateLimit
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.Locale import java.util.Locale
@ -15,6 +15,6 @@ class BorutoExplorer : Madara(
) { ) {
override val client: OkHttpClient = super.client.newBuilder() override val client: OkHttpClient = super.client.newBuilder()
.addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) .rateLimit(1, 2, TimeUnit.SECONDS)
.build() .build()
} }

View File

@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.extension.pt.cafecomyaoi 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.multisrc.madara.Madara
import eu.kanade.tachiyomi.network.interceptor.rateLimit
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.Locale import java.util.Locale
@ -15,6 +15,6 @@ class CafeComYaoi : Madara(
) { ) {
override val client: OkHttpClient = super.client.newBuilder() override val client: OkHttpClient = super.client.newBuilder()
.addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) .rateLimit(1, 2, TimeUnit.SECONDS)
.build() .build()
} }

View File

@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.extension.pt.cerisescans 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.multisrc.madara.Madara
import eu.kanade.tachiyomi.network.interceptor.rateLimit
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.Locale import java.util.Locale
@ -15,6 +15,6 @@ class CeriseScans : Madara(
) { ) {
override val client: OkHttpClient = super.client.newBuilder() override val client: OkHttpClient = super.client.newBuilder()
.addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) .rateLimit(1, 2, TimeUnit.SECONDS)
.build() .build()
} }

View File

@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.extension.pt.covenscan 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.multisrc.madara.Madara
import eu.kanade.tachiyomi.network.interceptor.rateLimit
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.Locale import java.util.Locale
@ -15,7 +15,7 @@ class CovenScan : Madara(
) { ) {
override val client: OkHttpClient = super.client.newBuilder() override val client: OkHttpClient = super.client.newBuilder()
.addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) .rateLimit(1, 2, TimeUnit.SECONDS)
.build() .build()
override val useNewChapterEndpoint = true override val useNewChapterEndpoint = true

View File

@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.extension.pt.cronosscan 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.multisrc.madara.Madara
import eu.kanade.tachiyomi.network.interceptor.rateLimit
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.Locale import java.util.Locale
@ -15,6 +15,6 @@ class CronosScan : Madara(
) { ) {
override val client: OkHttpClient = super.client.newBuilder() override val client: OkHttpClient = super.client.newBuilder()
.addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) .rateLimit(1, 2, TimeUnit.SECONDS)
.build() .build()
} }

View File

@ -1,8 +1,8 @@
package eu.kanade.tachiyomi.extension.pt.darkyurealm 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.multisrc.madara.Madara
import eu.kanade.tachiyomi.network.GET import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.network.interceptor.rateLimit
import eu.kanade.tachiyomi.source.model.SManga import eu.kanade.tachiyomi.source.model.SManga
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import okhttp3.Request import okhttp3.Request
@ -21,7 +21,7 @@ class DarkYueRealm : Madara(
override val id: Long = 593455310609863709 override val id: Long = 593455310609863709
override val client: OkHttpClient = super.client.newBuilder() override val client: OkHttpClient = super.client.newBuilder()
.addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) .rateLimit(1, 2, TimeUnit.SECONDS)
.build() .build()
override fun mangaDetailsRequest(manga: SManga): Request { override fun mangaDetailsRequest(manga: SManga): Request {

View File

@ -1,4 +0,0 @@
dependencies {
implementation project(':lib-ratelimit')
}

View File

@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.extension.pt.diskusscan 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.multisrc.madara.Madara
import eu.kanade.tachiyomi.network.interceptor.rateLimit
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.Locale import java.util.Locale
@ -15,6 +15,6 @@ class DiskusScan : Madara(
) { ) {
override val client: OkHttpClient = super.client.newBuilder() override val client: OkHttpClient = super.client.newBuilder()
.addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) .rateLimit(1, 2, TimeUnit.SECONDS)
.build() .build()
} }

View File

@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.extension.pt.dreamunionscan 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.multisrc.madara.Madara
import eu.kanade.tachiyomi.network.interceptor.rateLimit
import okhttp3.Interceptor import okhttp3.Interceptor
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import okhttp3.Response import okhttp3.Response
@ -19,7 +19,7 @@ class DreamUnionScan : Madara(
override val client: OkHttpClient = super.client.newBuilder() override val client: OkHttpClient = super.client.newBuilder()
.addInterceptor(::authWarningIntercept) .addInterceptor(::authWarningIntercept)
.addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) .rateLimit(1, 2, TimeUnit.SECONDS)
.build() .build()
private fun authWarningIntercept(chain: Interceptor.Chain): Response { private fun authWarningIntercept(chain: Interceptor.Chain): Response {

View File

@ -1,8 +1,8 @@
package eu.kanade.tachiyomi.extension.pt.dropescan 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.multisrc.madara.Madara
import eu.kanade.tachiyomi.network.GET import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.network.interceptor.rateLimit
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import okhttp3.Request import okhttp3.Request
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
@ -17,7 +17,7 @@ class DropeScan : Madara(
) { ) {
override val client: OkHttpClient = super.client.newBuilder() override val client: OkHttpClient = super.client.newBuilder()
.addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) .rateLimit(1, 2, TimeUnit.SECONDS)
.build() .build()
override val useNewChapterEndpoint = true override val useNewChapterEndpoint = true

View File

@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.extension.pt.estufadecristal 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.multisrc.madara.Madara
import eu.kanade.tachiyomi.network.interceptor.rateLimit
import eu.kanade.tachiyomi.source.model.SChapter import eu.kanade.tachiyomi.source.model.SChapter
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import okhttp3.Response import okhttp3.Response
@ -17,7 +17,7 @@ class EstufaDeCristal : Madara(
) { ) {
override val client: OkHttpClient = super.client.newBuilder() override val client: OkHttpClient = super.client.newBuilder()
.addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) .rateLimit(1, 2, TimeUnit.SECONDS)
.build() .build()
override val useNewChapterEndpoint = true override val useNewChapterEndpoint = true

View File

@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.extension.pt.fdmscan 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.multisrc.madara.Madara
import eu.kanade.tachiyomi.network.interceptor.rateLimit
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.Locale import java.util.Locale
@ -15,6 +15,6 @@ class FDMScan : Madara(
) { ) {
override val client: OkHttpClient = super.client.newBuilder() override val client: OkHttpClient = super.client.newBuilder()
.addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) .rateLimit(1, 2, TimeUnit.SECONDS)
.build() .build()
} }

View File

@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.extension.pt.finalscans 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.multisrc.madara.Madara
import eu.kanade.tachiyomi.network.interceptor.rateLimit
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.Locale import java.util.Locale
@ -15,6 +15,6 @@ class FinalScans : Madara(
) { ) {
override val client: OkHttpClient = super.client.newBuilder() override val client: OkHttpClient = super.client.newBuilder()
.addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) .rateLimit(1, 2, TimeUnit.SECONDS)
.build() .build()
} }

View File

@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.extension.en.firstkissmanga 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.multisrc.madara.Madara
import eu.kanade.tachiyomi.network.interceptor.rateLimit
import okhttp3.Headers import okhttp3.Headers
import java.util.concurrent.TimeUnit import java.util.concurrent.TimeUnit
@ -12,9 +12,7 @@ class FirstKissManga : Madara(
) { ) {
override fun headersBuilder(): Headers.Builder = super.headersBuilder().add("Referer", baseUrl) override fun headersBuilder(): Headers.Builder = super.headersBuilder().add("Referer", baseUrl)
private val rateLimitInterceptor = RateLimitInterceptor(1, 2, TimeUnit.SECONDS)
override val client = network.cloudflareClient.newBuilder() override val client = network.cloudflareClient.newBuilder()
.addNetworkInterceptor(rateLimitInterceptor) .rateLimit(1, 2, TimeUnit.SECONDS)
.build() .build()
} }

View File

@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.extension.en.firstkissmangaclub 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.multisrc.madara.Madara
import eu.kanade.tachiyomi.network.interceptor.rateLimit
import java.util.concurrent.TimeUnit import java.util.concurrent.TimeUnit
class FirstKissMangaClub : Madara( class FirstKissMangaClub : Madara(
@ -9,9 +9,8 @@ class FirstKissMangaClub : Madara(
"https://1stkissmanga.club", "https://1stkissmanga.club",
"en" "en"
) { ) {
private val rateLimitInterceptor = RateLimitInterceptor(1, 2, TimeUnit.SECONDS)
override val client = network.cloudflareClient.newBuilder() override val client = network.cloudflareClient.newBuilder()
.addNetworkInterceptor(rateLimitInterceptor) .rateLimit(1, 2, TimeUnit.SECONDS)
.build() .build()
} }

View File

@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.extension.en.firstkissmangalove 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.multisrc.madara.Madara
import eu.kanade.tachiyomi.network.interceptor.rateLimit
import java.util.concurrent.TimeUnit import java.util.concurrent.TimeUnit
class FirstKissMangaLove : Madara( class FirstKissMangaLove : Madara(
@ -9,9 +9,8 @@ class FirstKissMangaLove : Madara(
"https://1stkissmanga.love", "https://1stkissmanga.love",
"en" "en"
) { ) {
private val rateLimitInterceptor = RateLimitInterceptor(1, 2, TimeUnit.SECONDS)
override val client = network.cloudflareClient.newBuilder() override val client = network.cloudflareClient.newBuilder()
.addNetworkInterceptor(rateLimitInterceptor) .rateLimit(1, 2, TimeUnit.SECONDS)
.build() .build()
} }

View File

@ -1,8 +1,8 @@
package eu.kanade.tachiyomi.extension.en.firstkissmanhua 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.multisrc.madara.Madara
import eu.kanade.tachiyomi.network.GET 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.Page
import okhttp3.Request import okhttp3.Request
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
@ -15,10 +15,9 @@ class FirstKissManhua : Madara(
"en", "en",
SimpleDateFormat("d MMM yyyy", Locale.US) SimpleDateFormat("d MMM yyyy", Locale.US)
) { ) {
private val rateLimitInterceptor = RateLimitInterceptor(1, 2, TimeUnit.SECONDS)
override val client = network.cloudflareClient.newBuilder() override val client = network.cloudflareClient.newBuilder()
.addNetworkInterceptor(rateLimitInterceptor) .rateLimit(1, 2, TimeUnit.SECONDS)
.build() .build()
override fun imageRequest(page: Page): Request = GET(page.imageUrl!!, headersBuilder().add("Referer", "https://1stkissmanga.com").build()) override fun imageRequest(page: Page): Request = GET(page.imageUrl!!, headersBuilder().add("Referer", "https://1stkissmanga.com").build())

View File

@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.extension.pt.fleurblanche 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.multisrc.madara.Madara
import eu.kanade.tachiyomi.network.interceptor.rateLimit
import okhttp3.Headers import okhttp3.Headers
import okhttp3.Interceptor import okhttp3.Interceptor
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
@ -20,7 +20,7 @@ class FleurBlanche : Madara(
override val client: OkHttpClient = super.client.newBuilder() override val client: OkHttpClient = super.client.newBuilder()
.addInterceptor(::authWarningIntercept) .addInterceptor(::authWarningIntercept)
.addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) .rateLimit(1, 2, TimeUnit.SECONDS)
.build() .build()
override val useNewChapterEndpoint = true override val useNewChapterEndpoint = true

View File

@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.extension.pt.foxwhite 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.multisrc.madara.Madara
import eu.kanade.tachiyomi.network.interceptor.rateLimit
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.Locale import java.util.Locale
@ -15,6 +15,6 @@ class FoxWhite : Madara(
) { ) {
override val client: OkHttpClient = super.client.newBuilder() override val client: OkHttpClient = super.client.newBuilder()
.addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) .rateLimit(1, 2, TimeUnit.SECONDS)
.build() .build()
} }

View File

@ -1,13 +1,13 @@
package eu.kanade.tachiyomi.extension.en.freemanga 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.multisrc.madara.Madara
import eu.kanade.tachiyomi.network.interceptor.rateLimit
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import java.util.concurrent.TimeUnit import java.util.concurrent.TimeUnit
class FreeManga : Madara("Free Manga", "https://freemanga.me", "en") { class FreeManga : Madara("Free Manga", "https://freemanga.me", "en") {
override val client: OkHttpClient = super.client.newBuilder() override val client: OkHttpClient = super.client.newBuilder()
.addInterceptor(RateLimitInterceptor(1, 1, TimeUnit.SECONDS)) .rateLimit(1, 1, TimeUnit.SECONDS)
.build() .build()
} }

View File

@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.extension.pt.furioscans 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.multisrc.madara.Madara
import eu.kanade.tachiyomi.network.interceptor.rateLimit
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.Locale import java.util.Locale
@ -15,7 +15,7 @@ class FurioScans : Madara(
) { ) {
override val client: OkHttpClient = super.client.newBuilder() override val client: OkHttpClient = super.client.newBuilder()
.addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) .rateLimit(1, 2, TimeUnit.SECONDS)
.build() .build()
override val useNewChapterEndpoint = true override val useNewChapterEndpoint = true

View File

@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.extension.pt.glasssky 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.multisrc.madara.Madara
import eu.kanade.tachiyomi.network.interceptor.rateLimit
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.Locale import java.util.Locale
@ -15,6 +15,6 @@ class GlassSky : Madara(
) { ) {
override val client: OkHttpClient = super.client.newBuilder() override val client: OkHttpClient = super.client.newBuilder()
.addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) .rateLimit(1, 2, TimeUnit.SECONDS)
.build() .build()
} }

View File

@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.extension.pt.gooffansub 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.multisrc.madara.Madara
import eu.kanade.tachiyomi.network.interceptor.rateLimit
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.Locale import java.util.Locale
@ -15,7 +15,7 @@ class GoofFansub : Madara(
) { ) {
override val client: OkHttpClient = super.client.newBuilder() override val client: OkHttpClient = super.client.newBuilder()
.addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) .rateLimit(1, 2, TimeUnit.SECONDS)
.build() .build()
override val popularMangaUrlSelector = "div.post-title a:last-child" override val popularMangaUrlSelector = "div.post-title a:last-child"

View File

@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.extension.pt.helascan 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.multisrc.madara.Madara
import eu.kanade.tachiyomi.network.interceptor.rateLimit
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.Locale import java.util.Locale
@ -15,7 +15,7 @@ class HelaScan : Madara(
) { ) {
override val client: OkHttpClient = super.client.newBuilder() override val client: OkHttpClient = super.client.newBuilder()
.addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) .rateLimit(1, 2, TimeUnit.SECONDS)
.build() .build()
override val useNewChapterEndpoint = true override val useNewChapterEndpoint = true

View File

@ -1,13 +1,13 @@
package eu.kanade.tachiyomi.extension.en.hentai20 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.multisrc.madara.Madara
import eu.kanade.tachiyomi.network.interceptor.rateLimit
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import java.util.concurrent.TimeUnit import java.util.concurrent.TimeUnit
class Hentai20 : Madara("Hentai20", "https://hentai20.com", "en") { class Hentai20 : Madara("Hentai20", "https://hentai20.com", "en") {
override val client: OkHttpClient = super.client.newBuilder() override val client: OkHttpClient = super.client.newBuilder()
.addInterceptor(RateLimitInterceptor(1, 1, TimeUnit.SECONDS)) .rateLimit(1, 1, TimeUnit.SECONDS)
.build() .build()
} }

View File

@ -1,13 +1,13 @@
package eu.kanade.tachiyomi.extension.en.hentaidexy 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.multisrc.madara.Madara
import eu.kanade.tachiyomi.network.interceptor.rateLimit
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import java.util.concurrent.TimeUnit import java.util.concurrent.TimeUnit
class Hentaidexy : Madara("Hentaidexy", "https://hentaidexy.com", "en") { class Hentaidexy : Madara("Hentaidexy", "https://hentaidexy.com", "en") {
override val client: OkHttpClient = super.client.newBuilder() override val client: OkHttpClient = super.client.newBuilder()
.addInterceptor(RateLimitInterceptor(1, 1, TimeUnit.SECONDS)) .rateLimit(1, 1, TimeUnit.SECONDS)
.build() .build()
} }

View File

@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.extension.pt.hentaiteca 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.multisrc.madara.Madara
import eu.kanade.tachiyomi.network.interceptor.rateLimit
import okhttp3.Headers import okhttp3.Headers
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
@ -16,7 +16,7 @@ class HentaiTeca : Madara(
) { ) {
override val client: OkHttpClient = super.client.newBuilder() override val client: OkHttpClient = super.client.newBuilder()
.addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) .rateLimit(1, 2, TimeUnit.SECONDS)
.build() .build()
override fun headersBuilder(): Headers.Builder = Headers.Builder() override fun headersBuilder(): Headers.Builder = Headers.Builder()

View File

@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.extension.pt.hipercool 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.multisrc.madara.Madara
import eu.kanade.tachiyomi.network.interceptor.rateLimit
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import java.util.concurrent.TimeUnit import java.util.concurrent.TimeUnit
@ -11,6 +11,6 @@ class Hipercool : Madara("HipercooL", "https://hipercool.xyz", "pt-BR") {
override val versionId = 2 override val versionId = 2
override val client: OkHttpClient = super.client.newBuilder() override val client: OkHttpClient = super.client.newBuilder()
.addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) .rateLimit(1, 2, TimeUnit.SECONDS)
.build() .build()
} }

View File

@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.extension.pt.huntersscan 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.multisrc.madara.Madara
import eu.kanade.tachiyomi.network.interceptor.rateLimit
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.Locale import java.util.Locale
@ -15,6 +15,6 @@ class HuntersScan : Madara(
) { ) {
override val client: OkHttpClient = super.client.newBuilder() override val client: OkHttpClient = super.client.newBuilder()
.addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) .rateLimit(1, 2, TimeUnit.SECONDS)
.build() .build()
} }

View File

@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.extension.pt.ichirinnohanayuri 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.multisrc.madara.Madara
import eu.kanade.tachiyomi.network.interceptor.rateLimit
import okhttp3.Headers import okhttp3.Headers
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import java.io.IOException import java.io.IOException
@ -17,7 +17,7 @@ class IchirinNoHanaYuri : Madara(
) { ) {
override val client: OkHttpClient = super.client.newBuilder() override val client: OkHttpClient = super.client.newBuilder()
.addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) .rateLimit(1, 2, TimeUnit.SECONDS)
.addInterceptor { chain -> .addInterceptor { chain ->
val response = chain.proceed(chain.request()) val response = chain.proceed(chain.request())

View File

@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.extension.pt.imperioscans 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.multisrc.madara.Madara
import eu.kanade.tachiyomi.network.interceptor.rateLimit
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.Locale import java.util.Locale
@ -15,6 +15,6 @@ class ImperioScans : Madara(
) { ) {
override val client: OkHttpClient = super.client.newBuilder() override val client: OkHttpClient = super.client.newBuilder()
.addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) .rateLimit(1, 2, TimeUnit.SECONDS)
.build() .build()
} }

View File

@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.extension.pt.kamisamaexplorer 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.multisrc.madara.Madara
import eu.kanade.tachiyomi.network.interceptor.rateLimit
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.Locale import java.util.Locale
@ -15,6 +15,6 @@ class KamiSamaExplorer : Madara(
) { ) {
override val client: OkHttpClient = super.client.newBuilder() override val client: OkHttpClient = super.client.newBuilder()
.addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) .rateLimit(1, 2, TimeUnit.SECONDS)
.build() .build()
} }

View File

@ -1,8 +1,8 @@
package eu.kanade.tachiyomi.extension.pt.limascans 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.multisrc.madara.Madara
import eu.kanade.tachiyomi.network.GET import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.network.interceptor.rateLimit
import eu.kanade.tachiyomi.source.model.SManga import eu.kanade.tachiyomi.source.model.SManga
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import okhttp3.Request import okhttp3.Request
@ -18,7 +18,7 @@ class LimaScans : Madara(
) { ) {
override val client: OkHttpClient = super.client.newBuilder() override val client: OkHttpClient = super.client.newBuilder()
.addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) .rateLimit(1, 2, TimeUnit.SECONDS)
.build() .build()
override fun mangaDetailsRequest(manga: SManga): Request { override fun mangaDetailsRequest(manga: SManga): Request {

View File

@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.extension.pt.littlemonsterscan 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.multisrc.madara.Madara
import eu.kanade.tachiyomi.network.interceptor.rateLimit
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.Locale import java.util.Locale
@ -15,7 +15,7 @@ class LittleMonsterScan : Madara(
) { ) {
override val client: OkHttpClient = super.client.newBuilder() override val client: OkHttpClient = super.client.newBuilder()
.addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) .rateLimit(1, 2, TimeUnit.SECONDS)
.build() .build()
override val altName: String = "Nome alternativo: " override val altName: String = "Nome alternativo: "

View File

@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.extension.en.mangaclash 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.multisrc.madara.Madara
import eu.kanade.tachiyomi.network.interceptor.rateLimit
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.Locale import java.util.Locale
@ -15,6 +15,6 @@ class MangaClash : Madara(
) { ) {
override val client: OkHttpClient = super.client.newBuilder() override val client: OkHttpClient = super.client.newBuilder()
.addInterceptor(RateLimitInterceptor(1, 1, TimeUnit.SECONDS)) .rateLimit(1, 1, TimeUnit.SECONDS)
.build() .build()
} }

View File

@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.extension.es.mangafenix 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.multisrc.madara.Madara
import eu.kanade.tachiyomi.network.interceptor.rateLimit
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.Locale import java.util.Locale
@ -14,6 +14,6 @@ class MangaFenix : Madara(
) { ) {
override val client: OkHttpClient = super.client.newBuilder() override val client: OkHttpClient = super.client.newBuilder()
.addInterceptor(RateLimitInterceptor(1)) .rateLimit(1)
.build() .build()
} }

View File

@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.extension.all.mangaforfree 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.multisrc.madara.Madara
import eu.kanade.tachiyomi.network.interceptor.rateLimit
import eu.kanade.tachiyomi.source.Source import eu.kanade.tachiyomi.source.Source
import eu.kanade.tachiyomi.source.SourceFactory import eu.kanade.tachiyomi.source.SourceFactory
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
@ -29,6 +29,6 @@ abstract class MangaForFree(
) : Madara(name, baseUrl, lang) { ) : Madara(name, baseUrl, lang) {
override val client: OkHttpClient = super.client.newBuilder() override val client: OkHttpClient = super.client.newBuilder()
.addInterceptor(RateLimitInterceptor(1, 1, TimeUnit.SECONDS)) .rateLimit(1, 1, TimeUnit.SECONDS)
.build() .build()
} }

View File

@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.extension.en.mangakomi 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.multisrc.madara.Madara
import eu.kanade.tachiyomi.network.interceptor.rateLimit
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import java.util.concurrent.TimeUnit import java.util.concurrent.TimeUnit
@ -12,6 +12,6 @@ class MangaKomi : Madara(
) { ) {
override val client: OkHttpClient = super.client.newBuilder() override val client: OkHttpClient = super.client.newBuilder()
.addInterceptor(RateLimitInterceptor(1, 1, TimeUnit.SECONDS)) .rateLimit(1, 1, TimeUnit.SECONDS)
.build() .build()
} }

View File

@ -1,13 +1,13 @@
package eu.kanade.tachiyomi.extension.en.mangatuli 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.multisrc.madara.Madara
import eu.kanade.tachiyomi.network.interceptor.rateLimit
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import java.util.concurrent.TimeUnit import java.util.concurrent.TimeUnit
class MangaTuli : Madara("MangaTuli", "https://mangatuli.com", "en") { class MangaTuli : Madara("MangaTuli", "https://mangatuli.com", "en") {
override val client: OkHttpClient = super.client.newBuilder() override val client: OkHttpClient = super.client.newBuilder()
.addInterceptor(RateLimitInterceptor(1, 1, TimeUnit.SECONDS)) .rateLimit(1, 1, TimeUnit.SECONDS)
.build() .build()
} }

View File

@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.extension.en.manhuapro 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.multisrc.madara.Madara
import eu.kanade.tachiyomi.network.interceptor.rateLimit
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import java.util.concurrent.TimeUnit import java.util.concurrent.TimeUnit
@ -12,6 +12,6 @@ class ManhuaPro : Madara(
) { ) {
override val client: OkHttpClient = super.client.newBuilder() override val client: OkHttpClient = super.client.newBuilder()
.addInterceptor(RateLimitInterceptor(1, 1, TimeUnit.SECONDS)) .rateLimit(1, 1, TimeUnit.SECONDS)
.build() .build()
} }

View File

@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.extension.pt.markscans 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.multisrc.madara.Madara
import eu.kanade.tachiyomi.network.interceptor.rateLimit
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.Locale import java.util.Locale
@ -15,6 +15,6 @@ class MarkScans : Madara(
) { ) {
override val client: OkHttpClient = super.client.newBuilder() override val client: OkHttpClient = super.client.newBuilder()
.addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) .rateLimit(1, 2, TimeUnit.SECONDS)
.build() .build()
} }

View File

@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.extension.pt.mhentais 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.multisrc.madara.Madara
import eu.kanade.tachiyomi.network.interceptor.rateLimit
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.Locale import java.util.Locale
@ -15,6 +15,6 @@ class MHentais : Madara(
) { ) {
override val client: OkHttpClient = super.client.newBuilder() override val client: OkHttpClient = super.client.newBuilder()
.addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) .rateLimit(1, 2, TimeUnit.SECONDS)
.build() .build()
} }

View File

@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.extension.pt.minitwoscan 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.multisrc.madara.Madara
import eu.kanade.tachiyomi.network.interceptor.rateLimit
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.Locale import java.util.Locale
@ -15,6 +15,6 @@ class MiniTwoScan : Madara(
) { ) {
override val client: OkHttpClient = super.client.newBuilder() override val client: OkHttpClient = super.client.newBuilder()
.addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) .rateLimit(1, 2, TimeUnit.SECONDS)
.build() .build()
} }

View File

@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.extension.pt.miradscanlator 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.multisrc.madara.Madara
import eu.kanade.tachiyomi.network.interceptor.rateLimit
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.Locale import java.util.Locale
@ -15,6 +15,6 @@ class MiradScanlator : Madara(
) { ) {
override val client: OkHttpClient = super.client.newBuilder() override val client: OkHttpClient = super.client.newBuilder()
.addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) .rateLimit(1, 2, TimeUnit.SECONDS)
.build() .build()
} }

View File

@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.extension.pt.momonohanascan 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.multisrc.madara.Madara
import eu.kanade.tachiyomi.network.interceptor.rateLimit
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.Locale import java.util.Locale
@ -15,7 +15,7 @@ class MomoNoHanaScan : Madara(
) { ) {
override val client: OkHttpClient = super.client.newBuilder() override val client: OkHttpClient = super.client.newBuilder()
.addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) .rateLimit(1, 2, TimeUnit.SECONDS)
.build() .build()
override val useNewChapterEndpoint = true override val useNewChapterEndpoint = true

View File

@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.extension.pt.nekobreakerscan 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.multisrc.madara.Madara
import eu.kanade.tachiyomi.network.interceptor.rateLimit
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.Locale import java.util.Locale
@ -15,6 +15,6 @@ class NekoBreakerScan : Madara(
) { ) {
override val client: OkHttpClient = super.client.newBuilder() override val client: OkHttpClient = super.client.newBuilder()
.addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) .rateLimit(1, 2, TimeUnit.SECONDS)
.build() .build()
} }

View File

@ -6,11 +6,11 @@ import android.widget.Toast
import androidx.preference.EditTextPreference import androidx.preference.EditTextPreference
import androidx.preference.PreferenceScreen import androidx.preference.PreferenceScreen
import eu.kanade.tachiyomi.AppInfo import eu.kanade.tachiyomi.AppInfo
import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor
import eu.kanade.tachiyomi.multisrc.madara.Madara import eu.kanade.tachiyomi.multisrc.madara.Madara
import eu.kanade.tachiyomi.network.GET import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.network.POST import eu.kanade.tachiyomi.network.POST
import eu.kanade.tachiyomi.network.asObservable import eu.kanade.tachiyomi.network.asObservable
import eu.kanade.tachiyomi.network.interceptor.rateLimit
import eu.kanade.tachiyomi.source.ConfigurableSource import eu.kanade.tachiyomi.source.ConfigurableSource
import eu.kanade.tachiyomi.source.model.MangasPage import eu.kanade.tachiyomi.source.model.MangasPage
import eu.kanade.tachiyomi.source.model.Page import eu.kanade.tachiyomi.source.model.Page
@ -50,7 +50,7 @@ class NeoxScanlator :
.readTimeout(1, TimeUnit.MINUTES) .readTimeout(1, TimeUnit.MINUTES)
.addInterceptor(::titleCollectionIntercept) .addInterceptor(::titleCollectionIntercept)
.addInterceptor(::obsoleteCheckIntercept) .addInterceptor(::obsoleteCheckIntercept)
.addInterceptor(RateLimitInterceptor(1, 3, TimeUnit.SECONDS)) .rateLimit(1, 2, TimeUnit.SECONDS)
.build() .build()
override val altNameSelector = ".post-content_item:contains(Alternativo) .summary-content" override val altNameSelector = ".post-content_item:contains(Alternativo) .summary-content"

View File

@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.extension.pt.ninjascan 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.multisrc.madara.Madara
import eu.kanade.tachiyomi.network.interceptor.rateLimit
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.Locale import java.util.Locale
@ -15,6 +15,6 @@ class NinjaScan : Madara(
) { ) {
override val client: OkHttpClient = super.client.newBuilder() override val client: OkHttpClient = super.client.newBuilder()
.addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) .rateLimit(1, 2, TimeUnit.SECONDS)
.build() .build()
} }

View File

@ -1,13 +1,13 @@
package eu.kanade.tachiyomi.extension.pt.owscan 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.multisrc.madara.Madara
import eu.kanade.tachiyomi.network.interceptor.rateLimit
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import java.util.concurrent.TimeUnit import java.util.concurrent.TimeUnit
class OwScan : Madara("Ow Scan", "https://owscan.com", "pt-BR") { class OwScan : Madara("Ow Scan", "https://owscan.com", "pt-BR") {
override val client: OkHttpClient = super.client.newBuilder() override val client: OkHttpClient = super.client.newBuilder()
.addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) .rateLimit(1, 2, TimeUnit.SECONDS)
.build() .build()
} }

View File

@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.extension.pt.pirulitorosa 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.multisrc.madara.Madara
import eu.kanade.tachiyomi.network.interceptor.rateLimit
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.Locale import java.util.Locale
@ -15,7 +15,7 @@ class PirulitoRosa : Madara(
) { ) {
override val client: OkHttpClient = super.client.newBuilder() override val client: OkHttpClient = super.client.newBuilder()
.addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) .rateLimit(1, 2, TimeUnit.SECONDS)
.build() .build()
override val popularMangaUrlSelector = "div.post-title a:last-child" override val popularMangaUrlSelector = "div.post-title a:last-child"

View File

@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.extension.pt.prismahentais 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.multisrc.madara.Madara
import eu.kanade.tachiyomi.network.interceptor.rateLimit
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.Locale import java.util.Locale
@ -15,6 +15,6 @@ class PrismaHentais : Madara(
) { ) {
override val client: OkHttpClient = super.client.newBuilder() override val client: OkHttpClient = super.client.newBuilder()
.addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) .rateLimit(1, 2, TimeUnit.SECONDS)
.build() .build()
} }

View File

@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.extension.pt.prismascans 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.multisrc.madara.Madara
import eu.kanade.tachiyomi.network.interceptor.rateLimit
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.Locale import java.util.Locale
@ -15,7 +15,7 @@ class PrismaScans : Madara(
) { ) {
override val client: OkHttpClient = super.client.newBuilder() override val client: OkHttpClient = super.client.newBuilder()
.addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) .rateLimit(1, 2, TimeUnit.SECONDS)
.build() .build()
override val useNewChapterEndpoint = true override val useNewChapterEndpoint = true

View File

@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.extension.pt.projetoscanlator 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.multisrc.madara.Madara
import eu.kanade.tachiyomi.network.interceptor.rateLimit
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.Locale import java.util.Locale
@ -15,6 +15,6 @@ class ProjetoScanlator : Madara(
) { ) {
override val client: OkHttpClient = super.client.newBuilder() override val client: OkHttpClient = super.client.newBuilder()
.addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) .rateLimit(1, 2, TimeUnit.SECONDS)
.build() .build()
} }

View File

@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.extension.pt.randomscan 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.multisrc.madara.Madara
import eu.kanade.tachiyomi.network.interceptor.rateLimit
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.Locale import java.util.Locale
@ -15,6 +15,6 @@ class RandomScan : Madara(
) { ) {
override val client: OkHttpClient = super.client.newBuilder() override val client: OkHttpClient = super.client.newBuilder()
.addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) .rateLimit(1, 2, TimeUnit.SECONDS)
.build() .build()
} }

View File

@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.extension.all.reaperscans 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.multisrc.madara.Madara
import eu.kanade.tachiyomi.network.interceptor.rateLimit
import eu.kanade.tachiyomi.source.SourceFactory import eu.kanade.tachiyomi.source.SourceFactory
import eu.kanade.tachiyomi.source.model.SChapter import eu.kanade.tachiyomi.source.model.SChapter
import okhttp3.HttpUrl.Companion.toHttpUrl import okhttp3.HttpUrl.Companion.toHttpUrl
@ -62,7 +62,7 @@ class ReaperScansBr : ReaperScans(
override val id = 7767018058145795388 override val id = 7767018058145795388
override val client: OkHttpClient = super.client.newBuilder() override val client: OkHttpClient = super.client.newBuilder()
.addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) .rateLimit(1, 2, TimeUnit.SECONDS)
.build() .build()
} }

View File

@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.extension.pt.remangas 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.multisrc.madara.Madara
import eu.kanade.tachiyomi.network.interceptor.rateLimit
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.Locale import java.util.Locale
@ -18,6 +18,6 @@ class Remangas : Madara(
override val useNewChapterEndpoint = true override val useNewChapterEndpoint = true
override val client: OkHttpClient = super.client.newBuilder() override val client: OkHttpClient = super.client.newBuilder()
.addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) .rateLimit(1, 2, TimeUnit.SECONDS)
.build() .build()
} }

View File

@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.extension.pt.rwbyscan 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.multisrc.madara.Madara
import eu.kanade.tachiyomi.network.interceptor.rateLimit
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.Locale import java.util.Locale
@ -15,6 +15,6 @@ class RwbyScan : Madara(
) { ) {
override val client: OkHttpClient = super.client.newBuilder() override val client: OkHttpClient = super.client.newBuilder()
.addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) .rateLimit(1, 2, TimeUnit.SECONDS)
.build() .build()
} }

View File

@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.extension.pt.seikouscans 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.multisrc.madara.Madara
import eu.kanade.tachiyomi.network.interceptor.rateLimit
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.Locale import java.util.Locale
@ -15,7 +15,7 @@ class SeikouScans : Madara(
) { ) {
override val client: OkHttpClient = super.client.newBuilder() override val client: OkHttpClient = super.client.newBuilder()
.addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) .rateLimit(1, 2, TimeUnit.SECONDS)
.build() .build()
override val useNewChapterEndpoint = true override val useNewChapterEndpoint = true

View File

@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.extension.pt.sensainayuri 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.multisrc.madara.Madara
import eu.kanade.tachiyomi.network.interceptor.rateLimit
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.Locale import java.util.Locale
@ -15,7 +15,7 @@ class SensainaYuri : Madara(
) { ) {
override val client: OkHttpClient = super.client.newBuilder() override val client: OkHttpClient = super.client.newBuilder()
.addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) .rateLimit(1, 2, TimeUnit.SECONDS)
.build() .build()
override val useNewChapterEndpoint = true override val useNewChapterEndpoint = true

View File

@ -1,17 +1,16 @@
package eu.kanade.tachiyomi.extension.en.shieldmanga 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.multisrc.madara.Madara
import eu.kanade.tachiyomi.network.interceptor.rateLimit
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import java.util.concurrent.TimeUnit import java.util.concurrent.TimeUnit
class ShieldManga : Madara("Shield Manga", "https://shieldmanga.io", "en") { class ShieldManga : Madara("Shield Manga", "https://shieldmanga.io", "en") {
private val rateLimitInterceptor = RateLimitInterceptor(1)
override val client: OkHttpClient = network.cloudflareClient.newBuilder() override val client: OkHttpClient = network.cloudflareClient.newBuilder()
.connectTimeout(10, TimeUnit.SECONDS) .connectTimeout(10, TimeUnit.SECONDS)
.readTimeout(30, TimeUnit.SECONDS) .readTimeout(30, TimeUnit.SECONDS)
.addNetworkInterceptor(rateLimitInterceptor) .rateLimit(1)
.build() .build()
// The website does not flag the content. // The website does not flag the content.

View File

@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.extension.pt.shinzooscan 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.multisrc.madara.Madara
import eu.kanade.tachiyomi.network.interceptor.rateLimit
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.Locale import java.util.Locale
@ -15,6 +15,6 @@ class ShinzooScan : Madara(
) { ) {
override val client: OkHttpClient = super.client.newBuilder() override val client: OkHttpClient = super.client.newBuilder()
.addInterceptor(RateLimitInterceptor(1, 1, TimeUnit.SECONDS)) .rateLimit(1, 1, TimeUnit.SECONDS)
.build() .build()
} }

View File

@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.extension.pt.sinensis 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.multisrc.madara.Madara
import eu.kanade.tachiyomi.network.interceptor.rateLimit
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.Locale import java.util.Locale
@ -15,6 +15,6 @@ class Sinensis : Madara(
) { ) {
override val client: OkHttpClient = super.client.newBuilder() override val client: OkHttpClient = super.client.newBuilder()
.addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) .rateLimit(1, 2, TimeUnit.SECONDS)
.build() .build()
} }

View File

@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.extension.pt.smashscan 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.multisrc.madara.Madara
import eu.kanade.tachiyomi.network.interceptor.rateLimit
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.Locale import java.util.Locale
@ -15,7 +15,7 @@ class SmashScan : Madara(
) { ) {
override val client: OkHttpClient = super.client.newBuilder() override val client: OkHttpClient = super.client.newBuilder()
.addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) .rateLimit(1, 2, TimeUnit.SECONDS)
.build() .build()
override val altName = "Nome alternativo: " override val altName = "Nome alternativo: "

View File

@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.extension.pt.sodascan 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.multisrc.madara.Madara
import eu.kanade.tachiyomi.network.interceptor.rateLimit
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.Locale import java.util.Locale
@ -15,6 +15,6 @@ class SodaScan : Madara(
) { ) {
override val client: OkHttpClient = super.client.newBuilder() override val client: OkHttpClient = super.client.newBuilder()
.addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) .rateLimit(1, 2, TimeUnit.SECONDS)
.build() .build()
} }

View File

@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.extension.pt.sweettimescan 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.multisrc.madara.Madara
import eu.kanade.tachiyomi.network.interceptor.rateLimit
import eu.kanade.tachiyomi.source.model.MangasPage import eu.kanade.tachiyomi.source.model.MangasPage
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import okhttp3.Response import okhttp3.Response
@ -18,7 +18,7 @@ class SweetTimeScan : Madara(
) { ) {
override val client: OkHttpClient = super.client.newBuilder() override val client: OkHttpClient = super.client.newBuilder()
.addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) .rateLimit(1, 2, TimeUnit.SECONDS)
.build() .build()
// The source has novels in text format, so we need to filter them. // The source has novels in text format, so we need to filter them.

View File

@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.extension.pt.tatakaescan 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.multisrc.madara.Madara
import eu.kanade.tachiyomi.network.interceptor.rateLimit
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.Locale import java.util.Locale
@ -15,6 +15,6 @@ class TatakaeScan : Madara(
) { ) {
override val client: OkHttpClient = super.client.newBuilder() override val client: OkHttpClient = super.client.newBuilder()
.addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) .rateLimit(1, 2, TimeUnit.SECONDS)
.build() .build()
} }

View File

@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.extension.pt.thesugar 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.multisrc.madara.Madara
import eu.kanade.tachiyomi.network.interceptor.rateLimit
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.Locale import java.util.Locale
@ -15,7 +15,7 @@ class TheSugar : Madara(
) { ) {
override val client: OkHttpClient = super.client.newBuilder() override val client: OkHttpClient = super.client.newBuilder()
.addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) .rateLimit(1, 2, TimeUnit.SECONDS)
.build() .build()
override val useNewChapterEndpoint = true override val useNewChapterEndpoint = true

View File

@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.extension.pt.threequeensscanlator 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.multisrc.madara.Madara
import eu.kanade.tachiyomi.network.interceptor.rateLimit
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.Locale import java.util.Locale
@ -15,6 +15,6 @@ class ThreeQueensScanlator : Madara(
) { ) {
override val client: OkHttpClient = super.client.newBuilder() override val client: OkHttpClient = super.client.newBuilder()
.addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) .rateLimit(1, 2, TimeUnit.SECONDS)
.build() .build()
} }

View File

@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.extension.pt.vapohentai 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.multisrc.madara.Madara
import eu.kanade.tachiyomi.network.interceptor.rateLimit
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.Locale import java.util.Locale
@ -15,6 +15,6 @@ class VapoHentai : Madara(
) { ) {
override val client: OkHttpClient = super.client.newBuilder() override val client: OkHttpClient = super.client.newBuilder()
.addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) .rateLimit(1, 2, TimeUnit.SECONDS)
.build() .build()
} }

View File

@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.extension.pt.vaposcan 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.multisrc.madara.Madara
import eu.kanade.tachiyomi.network.interceptor.rateLimit
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.Locale import java.util.Locale
@ -18,7 +18,7 @@ class VapoScan : Madara(
override val versionId = 2 override val versionId = 2
override val client: OkHttpClient = super.client.newBuilder() override val client: OkHttpClient = super.client.newBuilder()
.addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) .rateLimit(1, 2, TimeUnit.SECONDS)
.build() .build()
override val useNewChapterEndpoint = true override val useNewChapterEndpoint = true

View File

@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.extension.pt.visbellum 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.multisrc.madara.Madara
import eu.kanade.tachiyomi.network.interceptor.rateLimit
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.Locale import java.util.Locale
@ -15,6 +15,6 @@ class Visbellum : Madara(
) { ) {
override val client: OkHttpClient = super.client.newBuilder() override val client: OkHttpClient = super.client.newBuilder()
.addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) .rateLimit(1, 2, TimeUnit.SECONDS)
.build() .build()
} }

View File

@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.extension.pt.warqueenscan 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.multisrc.madara.Madara
import eu.kanade.tachiyomi.network.interceptor.rateLimit
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.Locale import java.util.Locale
@ -15,7 +15,7 @@ class WarQueenScan : Madara(
) { ) {
override val client: OkHttpClient = super.client.newBuilder() override val client: OkHttpClient = super.client.newBuilder()
.addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) .rateLimit(1, 2, TimeUnit.SECONDS)
.connectTimeout(1, TimeUnit.MINUTES) .connectTimeout(1, TimeUnit.MINUTES)
.readTimeout(1, TimeUnit.MINUTES) .readTimeout(1, TimeUnit.MINUTES)
.writeTimeout(1, TimeUnit.MINUTES) .writeTimeout(1, TimeUnit.MINUTES)

View File

@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.extension.pt.winterscan 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.multisrc.madara.Madara
import eu.kanade.tachiyomi.network.interceptor.rateLimit
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.Locale import java.util.Locale
@ -15,6 +15,6 @@ class WinterScan : Madara(
) { ) {
override val client: OkHttpClient = super.client.newBuilder() override val client: OkHttpClient = super.client.newBuilder()
.addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) .rateLimit(1, 2, TimeUnit.SECONDS)
.build() .build()
} }

View File

@ -1,13 +1,13 @@
package eu.kanade.tachiyomi.extension.en.yaoimanga 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.multisrc.madara.Madara
import eu.kanade.tachiyomi.network.interceptor.rateLimit
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import java.util.concurrent.TimeUnit import java.util.concurrent.TimeUnit
class YaoiManga : Madara("Yaoi.mobi", "https://yaoi.mobi", "en") { class YaoiManga : Madara("Yaoi.mobi", "https://yaoi.mobi", "en") {
override val client: OkHttpClient = super.client.newBuilder() override val client: OkHttpClient = super.client.newBuilder()
.addInterceptor(RateLimitInterceptor(1, 1, TimeUnit.SECONDS)) .rateLimit(1, 1, TimeUnit.SECONDS)
.build() .build()
} }

View File

@ -1,8 +1,8 @@
package eu.kanade.tachiyomi.extension.pt.yaoitoshokan 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.multisrc.madara.Madara
import eu.kanade.tachiyomi.network.GET 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.Page
import okhttp3.Headers import okhttp3.Headers
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
@ -23,7 +23,7 @@ class YaoiToshokan : Madara(
.removeAll("User-Agent") .removeAll("User-Agent")
override val client: OkHttpClient = network.client.newBuilder() override val client: OkHttpClient = network.client.newBuilder()
.addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) .rateLimit(1, 2, TimeUnit.SECONDS)
.build() .build()
// Page has custom link to scan website. // Page has custom link to scan website.

View File

@ -1,8 +1,8 @@
package eu.kanade.tachiyomi.extension.all.yugenmangas 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.multisrc.madara.Madara
import eu.kanade.tachiyomi.network.GET import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.network.interceptor.rateLimit
import eu.kanade.tachiyomi.source.SourceFactory import eu.kanade.tachiyomi.source.SourceFactory
import eu.kanade.tachiyomi.source.model.SChapter import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.util.asJsoup import eu.kanade.tachiyomi.util.asJsoup
@ -50,7 +50,7 @@ class YugenMangasBr : YugenMangas(
override val client: OkHttpClient = super.client.newBuilder() override val client: OkHttpClient = super.client.newBuilder()
.addInterceptor(::uaIntercept) .addInterceptor(::uaIntercept)
.addInterceptor(RateLimitInterceptor(1, 3, TimeUnit.SECONDS)) .rateLimit(1, 3, TimeUnit.SECONDS)
.build() .build()
override fun headersBuilder(): Headers.Builder = Headers.Builder() override fun headersBuilder(): Headers.Builder = Headers.Builder()

View File

@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.extension.pt.yuriverso 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.multisrc.madara.Madara
import eu.kanade.tachiyomi.network.interceptor.rateLimit
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.Locale import java.util.Locale
@ -15,6 +15,6 @@ class YuriVerso : Madara(
) { ) {
override val client: OkHttpClient = super.client.newBuilder() override val client: OkHttpClient = super.client.newBuilder()
.addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) .rateLimit(1, 2, TimeUnit.SECONDS)
.build() .build()
} }

View File

@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.extension.pt.zombielandsagascans 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.multisrc.madara.Madara
import eu.kanade.tachiyomi.network.interceptor.rateLimit
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.Locale import java.util.Locale
@ -15,6 +15,6 @@ class ZombieLandSagaScans : Madara(
) { ) {
override val client: OkHttpClient = super.client.newBuilder() override val client: OkHttpClient = super.client.newBuilder()
.addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) .rateLimit(1, 2, TimeUnit.SECONDS)
.build() .build()
} }

View File

@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.extension.en.beehentai 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.multisrc.madtheme.MadTheme
import eu.kanade.tachiyomi.network.interceptor.rateLimitHost
import okhttp3.HttpUrl.Companion.toHttpUrl import okhttp3.HttpUrl.Companion.toHttpUrl
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import java.util.concurrent.TimeUnit import java.util.concurrent.TimeUnit
@ -12,45 +12,35 @@ class BeeHentai : MadTheme(
"en" "en"
) { ) {
override val client: OkHttpClient = network.cloudflareClient.newBuilder() override val client: OkHttpClient = network.cloudflareClient.newBuilder()
.addInterceptor( .rateLimitHost(
SpecificHostRateLimitInterceptor( "https://s1.mbcdnv1.xyz".toHttpUrl(),
"https://s1.mbcdnv1.xyz".toHttpUrl(), 5,
5, 1,
1, TimeUnit.SECONDS
TimeUnit.SECONDS
)
) )
.addInterceptor( .rateLimitHost(
SpecificHostRateLimitInterceptor( "https://s1.mbcdnv2.xyz".toHttpUrl(),
"https://s1.mbcdnv2.xyz".toHttpUrl(), 1,
1, 2,
2, TimeUnit.SECONDS
TimeUnit.SECONDS
)
) )
.addInterceptor( .rateLimitHost(
SpecificHostRateLimitInterceptor( "https://s1.mbcdnv3.xyz".toHttpUrl(),
"https://s1.mbcdnv3.xyz".toHttpUrl(), 1,
1, 2,
2, TimeUnit.SECONDS
TimeUnit.SECONDS
)
) )
.addInterceptor( .rateLimitHost(
SpecificHostRateLimitInterceptor( "https://s1.mbcdnv4.xyz".toHttpUrl(),
"https://s1.mbcdnv4.xyz".toHttpUrl(), 1,
1, 2,
2, TimeUnit.SECONDS
TimeUnit.SECONDS
)
) )
.addInterceptor( .rateLimitHost(
SpecificHostRateLimitInterceptor( "https://s1.mbcdnv5.xyz".toHttpUrl(),
"https://s1.mbcdnv5.xyz".toHttpUrl(), 1,
1, 2,
2, TimeUnit.SECONDS
TimeUnit.SECONDS
)
) )
.build() .build()
} }

View File

@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.extension.en.boxmanhwa 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.multisrc.madtheme.MadTheme
import eu.kanade.tachiyomi.network.interceptor.rateLimitHost
import okhttp3.HttpUrl.Companion.toHttpUrl import okhttp3.HttpUrl.Companion.toHttpUrl
import okhttp3.OkHttpClient import okhttp3.OkHttpClient
import java.util.concurrent.TimeUnit import java.util.concurrent.TimeUnit
@ -12,45 +12,35 @@ class BoxManhwa : MadTheme(
"en" "en"
) { ) {
override val client: OkHttpClient = network.cloudflareClient.newBuilder() override val client: OkHttpClient = network.cloudflareClient.newBuilder()
.addInterceptor( .rateLimitHost(
SpecificHostRateLimitInterceptor( "https://s1.mbcdnv1.xyz".toHttpUrl(),
"https://s1.mbcdnv1.xyz".toHttpUrl(), 5,
5, 1,
1, TimeUnit.SECONDS
TimeUnit.SECONDS
)
) )
.addInterceptor( .rateLimitHost(
SpecificHostRateLimitInterceptor( "https://s1.mbcdnv2.xyz".toHttpUrl(),
"https://s1.mbcdnv2.xyz".toHttpUrl(), 1,
1, 2,
2, TimeUnit.SECONDS
TimeUnit.SECONDS
)
) )
.addInterceptor( .rateLimitHost(
SpecificHostRateLimitInterceptor( "https://s1.mbcdnv3.xyz".toHttpUrl(),
"https://s1.mbcdnv3.xyz".toHttpUrl(), 1,
1, 2,
2, TimeUnit.SECONDS
TimeUnit.SECONDS
)
) )
.addInterceptor( .rateLimitHost(
SpecificHostRateLimitInterceptor( "https://s1.mbcdnv4.xyz".toHttpUrl(),
"https://s1.mbcdnv4.xyz".toHttpUrl(), 1,
1, 2,
2, TimeUnit.SECONDS
TimeUnit.SECONDS
)
) )
.addInterceptor( .rateLimitHost(
SpecificHostRateLimitInterceptor( "https://s1.mbcdnv5.xyz".toHttpUrl(),
"https://s1.mbcdnv5.xyz".toHttpUrl(), 1,
1, 2,
2, TimeUnit.SECONDS
TimeUnit.SECONDS
)
) )
.build() .build()
} }

Some files were not shown because too many files have changed in this diff Show More