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

This commit is contained in:
arkon 2022-06-05 16:33:49 -04:00 committed by GitHub
parent 86d04b11b7
commit 341d067afc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
113 changed files with 260 additions and 534 deletions

View File

@ -6,12 +6,8 @@ ext {
extName = 'Comick.fun' extName = 'Comick.fun'
pkgNameSuffix = 'all.comickfun' pkgNameSuffix = 'all.comickfun'
extClass = '.ComickFunFactory' extClass = '.ComickFunFactory'
extVersionCode = 9 extVersionCode = 10
isNsfw = true isNsfw = true
} }
dependencies {
implementation project(':lib-ratelimit')
}
apply from: "$rootDir/common.gradle" apply from: "$rootDir/common.gradle"

View File

@ -1,8 +1,8 @@
package eu.kanade.tachiyomi.extension.all.comickfun package eu.kanade.tachiyomi.extension.all.comickfun
import eu.kanade.tachiyomi.lib.ratelimit.SpecificHostRateLimitInterceptor
import eu.kanade.tachiyomi.network.GET import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.network.asObservableSuccess import eu.kanade.tachiyomi.network.asObservableSuccess
import eu.kanade.tachiyomi.network.interceptor.rateLimitHost
import eu.kanade.tachiyomi.source.model.Filter import eu.kanade.tachiyomi.source.model.Filter
import eu.kanade.tachiyomi.source.model.FilterList import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.MangasPage import eu.kanade.tachiyomi.source.model.MangasPage
@ -79,7 +79,7 @@ abstract class ComickFun(override val lang: String, private val comickFunLang: S
} }
) )
// Add interceptor to ratelimit api calls // Add interceptor to ratelimit api calls
builder.addNetworkInterceptor(SpecificHostRateLimitInterceptor(apiBase.toHttpUrl(), 2)) builder.rateLimitHost(apiBase.toHttpUrl(), 2)
this.client = builder.build() this.client = builder.build()
} }

View File

@ -6,11 +6,7 @@ ext {
extName = 'MANGA Plus by SHUEISHA' extName = 'MANGA Plus by SHUEISHA'
pkgNameSuffix = 'all.mangaplus' pkgNameSuffix = 'all.mangaplus'
extClass = '.MangaPlusFactory' extClass = '.MangaPlusFactory'
extVersionCode = 31 extVersionCode = 32
}
dependencies {
implementation project(':lib-ratelimit')
} }
apply from: "$rootDir/common.gradle" apply from: "$rootDir/common.gradle"

View File

@ -5,9 +5,9 @@ import android.content.SharedPreferences
import androidx.preference.ListPreference import androidx.preference.ListPreference
import androidx.preference.PreferenceScreen import androidx.preference.PreferenceScreen
import androidx.preference.SwitchPreferenceCompat import androidx.preference.SwitchPreferenceCompat
import eu.kanade.tachiyomi.lib.ratelimit.SpecificHostRateLimitInterceptor
import eu.kanade.tachiyomi.network.GET import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.network.asObservableSuccess import eu.kanade.tachiyomi.network.asObservableSuccess
import eu.kanade.tachiyomi.network.interceptor.rateLimitHost
import eu.kanade.tachiyomi.source.ConfigurableSource import eu.kanade.tachiyomi.source.ConfigurableSource
import eu.kanade.tachiyomi.source.model.FilterList import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.MangasPage import eu.kanade.tachiyomi.source.model.MangasPage
@ -53,8 +53,8 @@ abstract class MangaPlus(
override val client: OkHttpClient = network.client.newBuilder() override val client: OkHttpClient = network.client.newBuilder()
.addInterceptor(::imageIntercept) .addInterceptor(::imageIntercept)
.addInterceptor(::thumbnailIntercept) .addInterceptor(::thumbnailIntercept)
.addInterceptor(SpecificHostRateLimitInterceptor(API_URL.toHttpUrl(), 1)) .rateLimitHost(API_URL.toHttpUrl(), 1)
.addInterceptor(SpecificHostRateLimitInterceptor(baseUrl.toHttpUrl(), 2)) .rateLimitHost(baseUrl.toHttpUrl(), 2)
.build() .build()
private val json: Json by injectLazy() private val json: Json by injectLazy()

View File

@ -5,11 +5,7 @@ ext {
extName = 'MangaToon (Limited)' extName = 'MangaToon (Limited)'
pkgNameSuffix = 'all.mangatoon' pkgNameSuffix = 'all.mangatoon'
extClass = '.MangaToonFactory' extClass = '.MangaToonFactory'
extVersionCode = 3 extVersionCode = 4
}
dependencies {
implementation project(':lib-ratelimit')
} }
apply from: "$rootDir/common.gradle" apply from: "$rootDir/common.gradle"

View File

@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.extension.all.mangatoon package eu.kanade.tachiyomi.extension.all.mangatoon
import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor
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.FilterList import eu.kanade.tachiyomi.source.model.FilterList
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
@ -34,7 +34,7 @@ open class MangaToon(
override val supportsLatest = true override val supportsLatest = true
override val client: OkHttpClient = network.client.newBuilder() override val client: OkHttpClient = network.client.newBuilder()
.addInterceptor(RateLimitInterceptor(1, 1, TimeUnit.SECONDS)) .rateLimit(1, 1, TimeUnit.SECONDS)
.build() .build()
private val locale by lazy { Locale.forLanguageTag(lang) } private val locale by lazy { Locale.forLanguageTag(lang) }

View File

@ -5,12 +5,8 @@ ext {
extName = 'NHentai' extName = 'NHentai'
pkgNameSuffix = 'all.nhentai' pkgNameSuffix = 'all.nhentai'
extClass = '.NHFactory' extClass = '.NHFactory'
extVersionCode = 32 extVersionCode = 33
isNsfw = true isNsfw = true
} }
dependencies {
implementation project(':lib-ratelimit')
}
apply from: "$rootDir/common.gradle" apply from: "$rootDir/common.gradle"

View File

@ -8,9 +8,9 @@ import eu.kanade.tachiyomi.extension.all.nhentai.NHUtils.getNumPages
import eu.kanade.tachiyomi.extension.all.nhentai.NHUtils.getTagDescription import eu.kanade.tachiyomi.extension.all.nhentai.NHUtils.getTagDescription
import eu.kanade.tachiyomi.extension.all.nhentai.NHUtils.getTags import eu.kanade.tachiyomi.extension.all.nhentai.NHUtils.getTags
import eu.kanade.tachiyomi.extension.all.nhentai.NHUtils.getTime import eu.kanade.tachiyomi.extension.all.nhentai.NHUtils.getTime
import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor
import eu.kanade.tachiyomi.network.GET import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.network.asObservableSuccess import eu.kanade.tachiyomi.network.asObservableSuccess
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.Filter import eu.kanade.tachiyomi.source.model.Filter
import eu.kanade.tachiyomi.source.model.FilterList import eu.kanade.tachiyomi.source.model.FilterList
@ -43,9 +43,8 @@ open class NHentai(
override val supportsLatest = true override val supportsLatest = true
private val rateLimitInterceptor = RateLimitInterceptor(4)
override val client: OkHttpClient = network.cloudflareClient.newBuilder() override val client: OkHttpClient = network.cloudflareClient.newBuilder()
.addNetworkInterceptor(rateLimitInterceptor) .rateLimit(4)
.build() .build()
private val preferences: SharedPreferences by lazy { private val preferences: SharedPreferences by lazy {

View File

@ -5,11 +5,7 @@ ext {
extName = 'NOISE Manga' extName = 'NOISE Manga'
pkgNameSuffix = 'all.noisemanga' pkgNameSuffix = 'all.noisemanga'
extClass = '.NoiseMangaFactory' extClass = '.NoiseMangaFactory'
extVersionCode = 4 extVersionCode = 5
}
dependencies {
implementation project(':lib-ratelimit')
} }
apply from: "$rootDir/common.gradle" apply from: "$rootDir/common.gradle"

View File

@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.extension.all.noisemanga package eu.kanade.tachiyomi.extension.all.noisemanga
import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor
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.FilterList import eu.kanade.tachiyomi.source.model.FilterList
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
@ -26,7 +26,7 @@ abstract class NoiseManga(override val lang: String) : ParsedHttpSource() {
override val supportsLatest = false override val supportsLatest = false
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()
override fun headersBuilder(): Headers.Builder = Headers.Builder() override fun headersBuilder(): Headers.Builder = Headers.Builder()

View File

@ -6,11 +6,7 @@ ext {
extName = 'GMANGA' extName = 'GMANGA'
pkgNameSuffix = 'ar.gmanga' pkgNameSuffix = 'ar.gmanga'
extClass = '.Gmanga' extClass = '.Gmanga'
extVersionCode = 10 extVersionCode = 11
}
dependencies {
implementation project(':lib-ratelimit')
} }
apply from: "$rootDir/common.gradle" apply from: "$rootDir/common.gradle"

View File

@ -6,9 +6,9 @@ import eu.kanade.tachiyomi.extension.ar.gmanga.GmangaPreferences.Companion.PREF_
import eu.kanade.tachiyomi.extension.ar.gmanga.GmangaPreferences.Companion.PREF_CHAPTER_LISTING_SHOW_POPULAR import eu.kanade.tachiyomi.extension.ar.gmanga.GmangaPreferences.Companion.PREF_CHAPTER_LISTING_SHOW_POPULAR
import eu.kanade.tachiyomi.extension.ar.gmanga.dto.TableDto import eu.kanade.tachiyomi.extension.ar.gmanga.dto.TableDto
import eu.kanade.tachiyomi.extension.ar.gmanga.dto.asChapterList import eu.kanade.tachiyomi.extension.ar.gmanga.dto.asChapterList
import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor
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.interceptor.rateLimit
import eu.kanade.tachiyomi.source.ConfigurableSource import eu.kanade.tachiyomi.source.ConfigurableSource
import eu.kanade.tachiyomi.source.model.FilterList import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.MangasPage import eu.kanade.tachiyomi.source.model.MangasPage
@ -49,10 +49,8 @@ class Gmanga : ConfigurableSource, HttpSource() {
private val preferences = GmangaPreferences(id) private val preferences = GmangaPreferences(id)
private val rateLimitInterceptor = RateLimitInterceptor(4)
override val client: OkHttpClient = network.client.newBuilder() override val client: OkHttpClient = network.client.newBuilder()
.addNetworkInterceptor(rateLimitInterceptor) .rateLimit(4)
.build() .build()
override fun headersBuilder() = Headers.Builder().apply { override fun headersBuilder() = Headers.Builder().apply {

View File

@ -5,11 +5,7 @@ ext {
extName = 'Manga.ae' extName = 'Manga.ae'
pkgNameSuffix = 'ar.mangaae' pkgNameSuffix = 'ar.mangaae'
extClass = '.MangaAe' extClass = '.MangaAe'
extVersionCode = 8 extVersionCode = 9
}
dependencies {
implementation project(':lib-ratelimit')
} }
apply from: "$rootDir/common.gradle" apply from: "$rootDir/common.gradle"

View File

@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.extension.ar.mangaae package eu.kanade.tachiyomi.extension.ar.mangaae
import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor
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.Filter import eu.kanade.tachiyomi.source.model.Filter
import eu.kanade.tachiyomi.source.model.FilterList import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.Page import eu.kanade.tachiyomi.source.model.Page
@ -25,10 +25,8 @@ class MangaAe : ParsedHttpSource() {
override val supportsLatest = true override val supportsLatest = true
private val rateLimitInterceptor = RateLimitInterceptor(2)
override val client: OkHttpClient = network.cloudflareClient.newBuilder() override val client: OkHttpClient = network.cloudflareClient.newBuilder()
.addNetworkInterceptor(rateLimitInterceptor) .rateLimit(2)
.build() .build()
override fun headersBuilder(): Headers.Builder = Headers.Builder() override fun headersBuilder(): Headers.Builder = Headers.Builder()

View File

@ -1,4 +1,4 @@
apply plugin: 'com.android.application' apply plugin: 'com.android.application'
apply plugin: 'kotlin-android' apply plugin: 'kotlin-android'
ext { ext {

View File

@ -1,4 +1,4 @@
apply plugin: 'com.android.application' apply plugin: 'com.android.application'
apply plugin: 'kotlin-android' apply plugin: 'kotlin-android'
ext { ext {

View File

@ -5,11 +5,7 @@ ext {
extName = 'Dilbert' extName = 'Dilbert'
pkgNameSuffix = 'en.dilbert' pkgNameSuffix = 'en.dilbert'
extClass = '.Dilbert' extClass = '.Dilbert'
extVersionCode = 5 extVersionCode = 6
}
dependencies {
implementation project(':lib-ratelimit')
} }
apply from: "$rootDir/common.gradle" apply from: "$rootDir/common.gradle"

View File

@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.extension.en.dilbert package eu.kanade.tachiyomi.extension.en.dilbert
import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor
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.FilterList import eu.kanade.tachiyomi.source.model.FilterList
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
@ -26,7 +26,8 @@ class Dilbert : ParsedHttpSource() {
override val supportsLatest = false override val supportsLatest = false
override val client = network.client.newBuilder() override val client = network.client.newBuilder()
.addNetworkInterceptor(RateLimitInterceptor(3)).build() .rateLimit(3)
.build()
override fun fetchPopularManga(page: Int) = (currentYear downTo 1989).map { override fun fetchPopularManga(page: Int) = (currentYear downTo 1989).map {
SManga.create().apply { SManga.create().apply {

View File

@ -6,11 +6,7 @@ ext {
extName = 'Graphite Comics' extName = 'Graphite Comics'
pkgNameSuffix = 'en.graphitecomics' pkgNameSuffix = 'en.graphitecomics'
extClass = '.GraphiteComics' extClass = '.GraphiteComics'
extVersionCode = 1 extVersionCode = 2
}
dependencies {
implementation project(':lib-ratelimit')
} }
apply from: "$rootDir/common.gradle" apply from: "$rootDir/common.gradle"

View File

@ -1,9 +1,9 @@
package eu.kanade.tachiyomi.extension.en.graphitecomics package eu.kanade.tachiyomi.extension.en.graphitecomics
import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor
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.asObservableSuccess 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.FilterList
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
@ -41,7 +41,7 @@ class GraphiteComics : HttpSource() {
override val supportsLatest = false override val supportsLatest = false
override val client: OkHttpClient = network.cloudflareClient.newBuilder() override val client: OkHttpClient = network.cloudflareClient.newBuilder()
.addInterceptor(RateLimitInterceptor(2, 1, TimeUnit.SECONDS)) .rateLimit(2, 1, TimeUnit.SECONDS)
.build() .build()
private val json: Json by injectLazy() private val json: Json by injectLazy()

View File

@ -6,13 +6,8 @@ ext {
extName = 'INKR' extName = 'INKR'
pkgNameSuffix = 'en.inkr' pkgNameSuffix = 'en.inkr'
extClass = '.Inkr' extClass = '.Inkr'
extVersionCode = 3 extVersionCode = 4
isNsfw = true isNsfw = true
} }
dependencies {
implementation project(':lib-ratelimit')
}
apply from: "$rootDir/common.gradle" apply from: "$rootDir/common.gradle"

View File

@ -1,9 +1,9 @@
package eu.kanade.tachiyomi.extension.en.inkr package eu.kanade.tachiyomi.extension.en.inkr
import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor
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.asObservableSuccess 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.FilterList
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
@ -48,7 +48,7 @@ class Inkr : HttpSource() {
override val client: OkHttpClient = network.cloudflareClient.newBuilder() override val client: OkHttpClient = network.cloudflareClient.newBuilder()
.addInterceptor(::buildIdIntercept) .addInterceptor(::buildIdIntercept)
.addInterceptor(RateLimitInterceptor(2, 1, TimeUnit.SECONDS)) .rateLimit(2, 1, TimeUnit.SECONDS)
.build() .build()
private val json: Json by injectLazy() private val json: Json by injectLazy()

View File

@ -5,12 +5,8 @@ ext {
extName = 'Koushoku' extName = 'Koushoku'
pkgNameSuffix = 'en.koushoku' pkgNameSuffix = 'en.koushoku'
extClass = '.Koushoku' extClass = '.Koushoku'
extVersionCode = 2 extVersionCode = 3
isNsfw = true isNsfw = true
} }
dependencies {
implementation project(':lib-ratelimit')
}
apply from: "$rootDir/common.gradle" apply from: "$rootDir/common.gradle"

View File

@ -1,8 +1,8 @@
package eu.kanade.tachiyomi.extension.en.koushoku package eu.kanade.tachiyomi.extension.en.koushoku
import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor
import eu.kanade.tachiyomi.network.GET import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.network.asObservableSuccess import eu.kanade.tachiyomi.network.asObservableSuccess
import eu.kanade.tachiyomi.network.interceptor.rateLimit
import eu.kanade.tachiyomi.source.model.Filter import eu.kanade.tachiyomi.source.model.Filter
import eu.kanade.tachiyomi.source.model.FilterList import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.MangasPage import eu.kanade.tachiyomi.source.model.MangasPage
@ -34,9 +34,8 @@ class Koushoku : ParsedHttpSource() {
override val lang = "en" override val lang = "en"
override val supportsLatest = false override val supportsLatest = false
private val rateLimitInterceptor = RateLimitInterceptor(5)
override val client: OkHttpClient = network.cloudflareClient.newBuilder() override val client: OkHttpClient = network.cloudflareClient.newBuilder()
.addNetworkInterceptor(rateLimitInterceptor) .rateLimit(5)
.build() .build()
override fun latestUpdatesRequest(page: Int) = GET("$baseUrl/?page=$page", headers) override fun latestUpdatesRequest(page: Int) = GET("$baseUrl/?page=$page", headers)

View File

@ -5,12 +5,8 @@ ext {
extName = 'MangaDig' extName = 'MangaDig'
pkgNameSuffix = 'en.mangadig' pkgNameSuffix = 'en.mangadig'
extClass = '.MangaDig' extClass = '.MangaDig'
extVersionCode = 2 extVersionCode = 3
isNsfw = true isNsfw = true
} }
dependencies {
implementation project(path: ':lib-ratelimit')
}
apply from: "$rootDir/common.gradle" apply from: "$rootDir/common.gradle"

View File

@ -5,8 +5,8 @@ import android.app.Application
import android.content.SharedPreferences import android.content.SharedPreferences
import android.net.Uri import android.net.Uri
import android.util.Base64 import android.util.Base64
import eu.kanade.tachiyomi.lib.ratelimit.SpecificHostRateLimitInterceptor
import eu.kanade.tachiyomi.network.GET import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.network.interceptor.rateLimitHost
import eu.kanade.tachiyomi.source.ConfigurableSource import eu.kanade.tachiyomi.source.ConfigurableSource
import eu.kanade.tachiyomi.source.model.Filter import eu.kanade.tachiyomi.source.model.Filter
import eu.kanade.tachiyomi.source.model.FilterList import eu.kanade.tachiyomi.source.model.FilterList
@ -38,13 +38,12 @@ class MangaDig : ConfigurableSource, ParsedHttpSource() {
} }
// Client configs // Client configs
private val mainSiteRateLimitInterceptor = SpecificHostRateLimitInterceptor(
baseUrl.toHttpUrlOrNull()!!,
preferences.getString(MAINSITE_RATEPERMITS_PREF, MAINSITE_RATEPERMITS_PREF_DEFAULT)!!.toInt(),
preferences.getString(MAINSITE_RATEPERIOD_PREF, MAINSITE_RATEPERIOD_PREF_DEFAULT)!!.toLong(),
)
override val client: OkHttpClient = network.cloudflareClient.newBuilder() override val client: OkHttpClient = network.cloudflareClient.newBuilder()
.addNetworkInterceptor(mainSiteRateLimitInterceptor) .rateLimitHost(
baseUrl.toHttpUrlOrNull()!!,
preferences.getString(MAINSITE_RATEPERMITS_PREF, MAINSITE_RATEPERMITS_PREF_DEFAULT)!!.toInt(),
preferences.getString(MAINSITE_RATEPERIOD_PREF, MAINSITE_RATEPERIOD_PREF_DEFAULT)!!.toLong(),
)
.build() .build()
override fun headersBuilder(): Headers.Builder = Headers.Builder() override fun headersBuilder(): Headers.Builder = Headers.Builder()
.add("Referer", baseUrl) .add("Referer", baseUrl)

View File

@ -5,11 +5,7 @@ ext {
extName = 'Rain Of Snow' extName = 'Rain Of Snow'
pkgNameSuffix = 'en.rainofsnow' pkgNameSuffix = 'en.rainofsnow'
extClass = '.RainOfSnow' extClass = '.RainOfSnow'
extVersionCode = 7 extVersionCode = 8
}
dependencies {
implementation project(path: ':lib-ratelimit')
} }
apply from: "$rootDir/common.gradle" apply from: "$rootDir/common.gradle"

View File

@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.extension.en.rainofsnow package eu.kanade.tachiyomi.extension.en.rainofsnow
import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor
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.Filter import eu.kanade.tachiyomi.source.model.Filter
import eu.kanade.tachiyomi.source.model.FilterList import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.Page import eu.kanade.tachiyomi.source.model.Page
@ -29,12 +29,10 @@ open class RainOfSnow() : ParsedHttpSource() {
override val supportsLatest = false override val supportsLatest = false
private val rateLimitInterceptor = RateLimitInterceptor(2)
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(2)
.build() .build()
override fun popularMangaRequest(page: Int): Request { override fun popularMangaRequest(page: Int): Request {

View File

@ -1,4 +1,4 @@
apply plugin: 'com.android.application' apply plugin: 'com.android.application'
apply plugin: 'kotlin-android' apply plugin: 'kotlin-android'
ext { ext {
@ -8,8 +8,4 @@ ext {
extVersionCode = 2 extVersionCode = 2
} }
dependencies {
// implementation project(':lib-ratelimit')
}
apply from: "$rootDir/common.gradle" apply from: "$rootDir/common.gradle"

View File

@ -6,12 +6,11 @@ ext {
extName = 'VIZ Shonen Jump' extName = 'VIZ Shonen Jump'
pkgNameSuffix = 'en.vizshonenjump' pkgNameSuffix = 'en.vizshonenjump'
extClass = '.VizShonenJump' extClass = '.VizShonenJump'
extVersionCode = 11 extVersionCode = 12
} }
dependencies { dependencies {
implementation 'com.drewnoakes:metadata-extractor:2.14.0' implementation 'com.drewnoakes:metadata-extractor:2.14.0'
implementation project(':lib-ratelimit')
} }
apply from: "$rootDir/common.gradle" apply from: "$rootDir/common.gradle"

View File

@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.extension.en.vizshonenjump package eu.kanade.tachiyomi.extension.en.vizshonenjump
import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor
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.FilterList import eu.kanade.tachiyomi.source.model.FilterList
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
@ -46,7 +46,7 @@ class VizShonenJump : ParsedHttpSource() {
.addInterceptor(::authCheckIntercept) .addInterceptor(::authCheckIntercept)
.addInterceptor(::authChapterCheckIntercept) .addInterceptor(::authChapterCheckIntercept)
.addInterceptor(VizImageInterceptor()) .addInterceptor(VizImageInterceptor())
.addInterceptor(RateLimitInterceptor(1, 1, TimeUnit.SECONDS)) .rateLimit(1, 1, TimeUnit.SECONDS)
.build() .build()
override fun headersBuilder(): Headers.Builder = Headers.Builder() override fun headersBuilder(): Headers.Builder = Headers.Builder()

View File

@ -6,11 +6,7 @@ ext {
extName = 'Voyce.Me' extName = 'Voyce.Me'
pkgNameSuffix = 'en.voyceme' pkgNameSuffix = 'en.voyceme'
extClass = '.VoyceMe' extClass = '.VoyceMe'
extVersionCode = 1 extVersionCode = 2
}
dependencies {
implementation project(':lib-ratelimit')
} }
apply from: "$rootDir/common.gradle" apply from: "$rootDir/common.gradle"

View File

@ -1,9 +1,9 @@
package eu.kanade.tachiyomi.extension.en.voyceme package eu.kanade.tachiyomi.extension.en.voyceme
import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor
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.asObservableSuccess 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.FilterList
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
@ -45,7 +45,7 @@ class VoyceMe : HttpSource() {
override val supportsLatest = true override val supportsLatest = true
override val client: OkHttpClient = network.cloudflareClient.newBuilder() override val client: OkHttpClient = network.cloudflareClient.newBuilder()
.addInterceptor(RateLimitInterceptor(2, 1, TimeUnit.SECONDS)) .rateLimit(2, 1, TimeUnit.SECONDS)
.build() .build()
private val json: Json by injectLazy() private val json: Json by injectLazy()

View File

@ -6,11 +6,7 @@ ext {
extName = 'War For Rayuba' extName = 'War For Rayuba'
pkgNameSuffix = 'en.warforrayuba' pkgNameSuffix = 'en.warforrayuba'
extClass = '.WarForRayuba' extClass = '.WarForRayuba'
extVersionCode = 1 extVersionCode = 2
}
dependencies {
implementation project(':lib-ratelimit')
} }
apply from: "$rootDir/common.gradle" apply from: "$rootDir/common.gradle"

View File

@ -4,9 +4,9 @@ import android.os.Build
import eu.kanade.tachiyomi.AppInfo import eu.kanade.tachiyomi.AppInfo
import eu.kanade.tachiyomi.extension.en.warforrayuba.dto.PageDto import eu.kanade.tachiyomi.extension.en.warforrayuba.dto.PageDto
import eu.kanade.tachiyomi.extension.en.warforrayuba.dto.RoundDto import eu.kanade.tachiyomi.extension.en.warforrayuba.dto.RoundDto
import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor
import eu.kanade.tachiyomi.network.GET import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.network.asObservableSuccess 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.FilterList
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
@ -32,7 +32,8 @@ class WarForRayuba : HttpSource() {
override val supportsLatest = false override val supportsLatest = false
override val client = network.cloudflareClient.newBuilder() override val client = network.cloudflareClient.newBuilder()
.addNetworkInterceptor(RateLimitInterceptor(4)).build() .rateLimit(4)
.build()
private val json = Json { private val json = Json {
isLenient = true isLenient = true

View File

@ -6,12 +6,8 @@ ext {
extName = 'ZinChanManga' extName = 'ZinChanManga'
pkgNameSuffix = 'en.zinchanmanga' pkgNameSuffix = 'en.zinchanmanga'
extClass = '.ZinChanManga' extClass = '.ZinChanManga'
extVersionCode = 4 extVersionCode = 5
isNsfw = true isNsfw = true
} }
dependencies {
implementation project(':lib-ratelimit')
}
apply from: "$rootDir/common.gradle" apply from: "$rootDir/common.gradle"

View File

@ -1,8 +1,8 @@
package eu.kanade.tachiyomi.extension.en.zinchanmanga package eu.kanade.tachiyomi.extension.en.zinchanmanga
import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor
import eu.kanade.tachiyomi.network.GET import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.network.asObservableSuccess 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.FilterList
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
@ -28,7 +28,7 @@ class ZinChanManga : HttpSource() {
private val apiClient by lazy { private val apiClient by lazy {
network.client.newBuilder() network.client.newBuilder()
.sslSocketFactory(ZinChanCert.factory, ZinChanCert.manager) .sslSocketFactory(ZinChanCert.factory, ZinChanCert.manager)
.addInterceptor(RateLimitInterceptor(5, 50)) .rateLimit(5, 50)
.build() .build()
} }

View File

@ -5,12 +5,8 @@ ext {
extName = 'LectorManga' extName = 'LectorManga'
pkgNameSuffix = 'es.lectormanga' pkgNameSuffix = 'es.lectormanga'
extClass = '.LectorManga' extClass = '.LectorManga'
extVersionCode = 23 extVersionCode = 24
isNsfw = true isNsfw = true
} }
dependencies {
implementation project(':lib-ratelimit')
}
apply from: "$rootDir/common.gradle" apply from: "$rootDir/common.gradle"

View File

@ -2,9 +2,9 @@ package eu.kanade.tachiyomi.extension.es.lectormanga
import android.app.Application import android.app.Application
import android.content.SharedPreferences import android.content.SharedPreferences
import eu.kanade.tachiyomi.lib.ratelimit.SpecificHostRateLimitInterceptor
import eu.kanade.tachiyomi.network.GET import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.network.asObservableSuccess import eu.kanade.tachiyomi.network.asObservableSuccess
import eu.kanade.tachiyomi.network.interceptor.rateLimitHost
import eu.kanade.tachiyomi.source.ConfigurableSource import eu.kanade.tachiyomi.source.ConfigurableSource
import eu.kanade.tachiyomi.source.model.Filter import eu.kanade.tachiyomi.source.model.Filter
import eu.kanade.tachiyomi.source.model.FilterList import eu.kanade.tachiyomi.source.model.FilterList
@ -52,37 +52,27 @@ class LectorManga : ConfigurableSource, ParsedHttpSource() {
Injekt.get<Application>().getSharedPreferences("source_$id", 0x0000) Injekt.get<Application>().getSharedPreferences("source_$id", 0x0000)
} }
private val webRateLimitInterceptor = SpecificHostRateLimitInterceptor(
baseUrl.toHttpUrlOrNull()!!,
preferences.getString(WEB_RATELIMIT_PREF, WEB_RATELIMIT_PREF_DEFAULT_VALUE)!!.toInt(), 60
)
private val imageCDNRateLimitInterceptor = SpecificHostRateLimitInterceptor(
imageCDNUrls[0].toHttpUrlOrNull()!!,
preferences.getString(IMAGE_CDN_RATELIMIT_PREF, IMAGE_CDN_RATELIMIT_PREF_DEFAULT_VALUE)!!.toInt(), 60
)
private val imageCDNRateLimitInterceptor1 = SpecificHostRateLimitInterceptor(
imageCDNUrls[1].toHttpUrlOrNull()!!,
preferences.getString(IMAGE_CDN_RATELIMIT_PREF, IMAGE_CDN_RATELIMIT_PREF_DEFAULT_VALUE)!!.toInt(), 60
)
private val imageCDNRateLimitInterceptor2 = SpecificHostRateLimitInterceptor(
imageCDNUrls[2].toHttpUrlOrNull()!!,
preferences.getString(IMAGE_CDN_RATELIMIT_PREF, IMAGE_CDN_RATELIMIT_PREF_DEFAULT_VALUE)!!.toInt(), 60
)
private val imageCDNRateLimitInterceptor3 = SpecificHostRateLimitInterceptor(
imageCDNUrls[3].toHttpUrlOrNull()!!,
preferences.getString(IMAGE_CDN_RATELIMIT_PREF, IMAGE_CDN_RATELIMIT_PREF_DEFAULT_VALUE)!!.toInt(), 60
)
override val client: OkHttpClient = network.client.newBuilder() override val client: OkHttpClient = network.client.newBuilder()
.addNetworkInterceptor(webRateLimitInterceptor) .rateLimitHost(
.addNetworkInterceptor(imageCDNRateLimitInterceptor) baseUrl.toHttpUrlOrNull()!!,
.addNetworkInterceptor(imageCDNRateLimitInterceptor1) preferences.getString(WEB_RATELIMIT_PREF, WEB_RATELIMIT_PREF_DEFAULT_VALUE)!!.toInt(), 60
.addNetworkInterceptor(imageCDNRateLimitInterceptor2) )
.addNetworkInterceptor(imageCDNRateLimitInterceptor3) .rateLimitHost(
imageCDNUrls[0].toHttpUrlOrNull()!!,
preferences.getString(IMAGE_CDN_RATELIMIT_PREF, IMAGE_CDN_RATELIMIT_PREF_DEFAULT_VALUE)!!.toInt(), 60
)
.rateLimitHost(
imageCDNUrls[1].toHttpUrlOrNull()!!,
preferences.getString(IMAGE_CDN_RATELIMIT_PREF, IMAGE_CDN_RATELIMIT_PREF_DEFAULT_VALUE)!!.toInt(), 60
)
.rateLimitHost(
imageCDNUrls[2].toHttpUrlOrNull()!!,
preferences.getString(IMAGE_CDN_RATELIMIT_PREF, IMAGE_CDN_RATELIMIT_PREF_DEFAULT_VALUE)!!.toInt(), 60
)
.rateLimitHost(
imageCDNUrls[3].toHttpUrlOrNull()!!,
preferences.getString(IMAGE_CDN_RATELIMIT_PREF, IMAGE_CDN_RATELIMIT_PREF_DEFAULT_VALUE)!!.toInt(), 60
)
.build() .build()
override fun popularMangaRequest(page: Int) = GET("$baseUrl/library?order_item=likes_count&order_dir=desc&type=&filter_by=title&page=$page", headers) override fun popularMangaRequest(page: Int) = GET("$baseUrl/library?order_item=likes_count&order_dir=desc&type=&filter_by=title&page=$page", headers)

View File

@ -5,12 +5,8 @@ ext {
extName = 'TuMangaOnline' extName = 'TuMangaOnline'
pkgNameSuffix = 'es.tumangaonline' pkgNameSuffix = 'es.tumangaonline'
extClass = '.TuMangaOnline' extClass = '.TuMangaOnline'
extVersionCode = 37 extVersionCode = 38
isNsfw = true isNsfw = true
} }
dependencies {
implementation project(':lib-ratelimit')
}
apply from: "$rootDir/common.gradle" apply from: "$rootDir/common.gradle"

View File

@ -2,9 +2,9 @@ package eu.kanade.tachiyomi.extension.es.tumangaonline
import android.app.Application import android.app.Application
import android.content.SharedPreferences import android.content.SharedPreferences
import eu.kanade.tachiyomi.lib.ratelimit.SpecificHostRateLimitInterceptor
import eu.kanade.tachiyomi.network.GET import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.network.asObservableSuccess import eu.kanade.tachiyomi.network.asObservableSuccess
import eu.kanade.tachiyomi.network.interceptor.rateLimitHost
import eu.kanade.tachiyomi.source.ConfigurableSource import eu.kanade.tachiyomi.source.ConfigurableSource
import eu.kanade.tachiyomi.source.model.Filter import eu.kanade.tachiyomi.source.model.Filter
import eu.kanade.tachiyomi.source.model.FilterList import eu.kanade.tachiyomi.source.model.FilterList
@ -52,21 +52,17 @@ class TuMangaOnline : ConfigurableSource, ParsedHttpSource() {
Injekt.get<Application>().getSharedPreferences("source_$id", 0x0000) Injekt.get<Application>().getSharedPreferences("source_$id", 0x0000)
} }
private val webRateLimitInterceptor = SpecificHostRateLimitInterceptor(
baseUrl.toHttpUrlOrNull()!!,
preferences.getString(WEB_RATELIMIT_PREF, WEB_RATELIMIT_PREF_DEFAULT_VALUE)!!.toInt(),
60
)
private val imageCDNRateLimitInterceptor = SpecificHostRateLimitInterceptor(
imageCDNUrl.toHttpUrlOrNull()!!,
preferences.getString(IMAGE_CDN_RATELIMIT_PREF, IMAGE_CDN_RATELIMIT_PREF_DEFAULT_VALUE)!!.toInt(),
60
)
override val client: OkHttpClient = network.client.newBuilder() override val client: OkHttpClient = network.client.newBuilder()
.addNetworkInterceptor(webRateLimitInterceptor) .rateLimitHost(
.addNetworkInterceptor(imageCDNRateLimitInterceptor) baseUrl.toHttpUrlOrNull()!!,
preferences.getString(WEB_RATELIMIT_PREF, WEB_RATELIMIT_PREF_DEFAULT_VALUE)!!.toInt(),
60
)
.rateLimitHost(
imageCDNUrl.toHttpUrlOrNull()!!,
preferences.getString(IMAGE_CDN_RATELIMIT_PREF, IMAGE_CDN_RATELIMIT_PREF_DEFAULT_VALUE)!!.toInt(),
60
)
.build() .build()
// Marks erotic content as false and excludes: Ecchi(6), GirlsLove(17), BoysLove(18) and Harem(19) genders // Marks erotic content as false and excludes: Ecchi(6), GirlsLove(17), BoysLove(18) and Harem(19) genders

View File

@ -5,11 +5,7 @@ ext {
extName = 'FuryoSquad' extName = 'FuryoSquad'
pkgNameSuffix = 'fr.furyosquad' pkgNameSuffix = 'fr.furyosquad'
extClass = '.FuryoSquad' extClass = '.FuryoSquad'
extVersionCode = 1 extVersionCode = 2
}
dependencies {
implementation project(':lib-ratelimit')
} }
apply from: "$rootDir/common.gradle" apply from: "$rootDir/common.gradle"

View File

@ -1,8 +1,8 @@
package eu.kanade.tachiyomi.extension.fr.furyosquad package eu.kanade.tachiyomi.extension.fr.furyosquad
import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor
import eu.kanade.tachiyomi.network.GET import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.network.asObservableSuccess 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.FilterList
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
@ -31,12 +31,10 @@ class FuryoSquad : ParsedHttpSource() {
override val supportsLatest = true override val supportsLatest = true
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()
// Popular // Popular

View File

@ -5,11 +5,7 @@ ext {
extName = 'Mangakawaii' extName = 'Mangakawaii'
pkgNameSuffix = 'fr.mangakawaii' pkgNameSuffix = 'fr.mangakawaii'
extClass = '.MangaKawaii' extClass = '.MangaKawaii'
extVersionCode = 34 extVersionCode = 35
}
dependencies {
implementation project(':lib-ratelimit')
} }
apply from: "$rootDir/common.gradle" apply from: "$rootDir/common.gradle"

View File

@ -1,8 +1,8 @@
package eu.kanade.tachiyomi.extension.fr.mangakawaii package eu.kanade.tachiyomi.extension.fr.mangakawaii
import android.net.Uri import android.net.Uri
import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor
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.FilterList import eu.kanade.tachiyomi.source.model.FilterList
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
@ -32,12 +32,11 @@ class MangaKawaii : ParsedHttpSource() {
val cdnUrl = "https://cdn.mangakawaii.pics" val cdnUrl = "https://cdn.mangakawaii.pics"
override val lang = "fr" override val lang = "fr"
override val supportsLatest = true override val supportsLatest = true
private val rateLimitInterceptor = RateLimitInterceptor(1) // 1 request per second
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()
protected open val userAgentRandomizer1 = "${Random.nextInt(9).absoluteValue}" protected open val userAgentRandomizer1 = "${Random.nextInt(9).absoluteValue}"

View File

@ -5,11 +5,7 @@ ext {
extName = 'Scantrad' extName = 'Scantrad'
pkgNameSuffix = 'fr.scantrad' pkgNameSuffix = 'fr.scantrad'
extClass = '.Scantrad' extClass = '.Scantrad'
extVersionCode = 17 extVersionCode = 18
}
dependencies {
implementation project(':lib-ratelimit')
} }
apply from: "$rootDir/common.gradle" apply from: "$rootDir/common.gradle"

View File

@ -1,8 +1,8 @@
package eu.kanade.tachiyomi.extension.fr.scantrad package eu.kanade.tachiyomi.extension.fr.scantrad
import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor
import eu.kanade.tachiyomi.network.GET import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.network.asObservableSuccess 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.FilterList
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
@ -32,12 +32,10 @@ class Scantrad : ParsedHttpSource() {
override val supportsLatest = true override val supportsLatest = true
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()
override fun headersBuilder(): Headers.Builder = Headers.Builder() override fun headersBuilder(): Headers.Builder = Headers.Builder()

View File

@ -5,11 +5,7 @@ ext {
extName = 'NewToki / ManaToki' extName = 'NewToki / ManaToki'
pkgNameSuffix = 'ko.newtoki' pkgNameSuffix = 'ko.newtoki'
extClass = '.NewTokiFactory' extClass = '.NewTokiFactory'
extVersionCode = 22 extVersionCode = 23
}
dependencies {
implementation project(':lib-ratelimit')
} }
apply from: "$rootDir/common.gradle" apply from: "$rootDir/common.gradle"

View File

@ -4,10 +4,10 @@ import android.annotation.SuppressLint
import android.app.Application import android.app.Application
import android.content.SharedPreferences import android.content.SharedPreferences
import android.widget.Toast import android.widget.Toast
import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor
import eu.kanade.tachiyomi.AppInfo import eu.kanade.tachiyomi.AppInfo
import eu.kanade.tachiyomi.network.GET import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.network.asObservableSuccess import eu.kanade.tachiyomi.network.asObservableSuccess
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.FilterList import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.MangasPage import eu.kanade.tachiyomi.source.model.MangasPage
@ -40,7 +40,7 @@ open class NewToki(override val name: String, private val defaultBaseUrl: String
override val client: OkHttpClient = network.cloudflareClient override val client: OkHttpClient = network.cloudflareClient
protected val rateLimitedClient: OkHttpClient by lazy { protected val rateLimitedClient: OkHttpClient by lazy {
network.cloudflareClient.newBuilder() network.cloudflareClient.newBuilder()
.addNetworkInterceptor(RateLimitInterceptor(1, getRateLimitPeriod())) .rateLimit(1, getRateLimitPeriod())
.build() .build()
} }

View File

@ -6,11 +6,7 @@ ext {
extName = 'Argos Scan' extName = 'Argos Scan'
pkgNameSuffix = 'pt.argosscan' pkgNameSuffix = 'pt.argosscan'
extClass = '.ArgosScan' extClass = '.ArgosScan'
extVersionCode = 20 extVersionCode = 21
}
dependencies {
implementation project(':lib-ratelimit')
} }
apply from: "$rootDir/common.gradle" apply from: "$rootDir/common.gradle"

View File

@ -5,10 +5,10 @@ import android.content.SharedPreferences
import android.text.InputType import android.text.InputType
import androidx.preference.EditTextPreference import androidx.preference.EditTextPreference
import androidx.preference.PreferenceScreen import androidx.preference.PreferenceScreen
import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor
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.asObservableSuccess import eu.kanade.tachiyomi.network.asObservableSuccess
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.FilterList import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.MangasPage import eu.kanade.tachiyomi.source.model.MangasPage
@ -54,7 +54,7 @@ class ArgosScan : HttpSource(), ConfigurableSource {
override val client: OkHttpClient = network.cloudflareClient.newBuilder() override val client: OkHttpClient = network.cloudflareClient.newBuilder()
.addInterceptor(::loginIntercept) .addInterceptor(::loginIntercept)
.addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) .rateLimit(1, 2, TimeUnit.SECONDS)
.build() .build()
private val json: Json by injectLazy() private val json: Json by injectLazy()

View File

@ -5,12 +5,8 @@ ext {
extName = 'Bakai' extName = 'Bakai'
pkgNameSuffix = 'pt.bakai' pkgNameSuffix = 'pt.bakai'
extClass = '.Bakai' extClass = '.Bakai'
extVersionCode = 2 extVersionCode = 3
isNsfw = true isNsfw = true
} }
dependencies {
implementation project(':lib-ratelimit')
}
apply from: "$rootDir/common.gradle" apply from: "$rootDir/common.gradle"

View File

@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.extension.pt.bakai package eu.kanade.tachiyomi.extension.pt.bakai
import eu.kanade.tachiyomi.lib.ratelimit.SpecificHostRateLimitInterceptor
import eu.kanade.tachiyomi.network.GET import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.network.interceptor.rateLimitHost
import eu.kanade.tachiyomi.source.model.FilterList import eu.kanade.tachiyomi.source.model.FilterList
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
@ -27,8 +27,8 @@ class Bakai : ParsedHttpSource() {
override val supportsLatest = true override val supportsLatest = true
override val client: OkHttpClient = network.cloudflareClient.newBuilder() override val client: OkHttpClient = network.cloudflareClient.newBuilder()
.addInterceptor(SpecificHostRateLimitInterceptor(baseUrl.toHttpUrl(), 1, 2)) .rateLimitHost(baseUrl.toHttpUrl(), 1, 2)
.addInterceptor(SpecificHostRateLimitInterceptor(CDN_URL.toHttpUrl(), 1, 1)) .rateLimitHost(CDN_URL.toHttpUrl(), 1, 1)
.build() .build()
override fun headersBuilder(): Headers.Builder = Headers.Builder() override fun headersBuilder(): Headers.Builder = Headers.Builder()

View File

@ -5,12 +5,8 @@ ext {
extName = 'BR Mangás' extName = 'BR Mangás'
pkgNameSuffix = 'pt.brmangas' pkgNameSuffix = 'pt.brmangas'
extClass = '.BrMangas' extClass = '.BrMangas'
extVersionCode = 3 extVersionCode = 4
isNsfw = true isNsfw = true
} }
dependencies {
implementation project(':lib-ratelimit')
}
apply from: "$rootDir/common.gradle" apply from: "$rootDir/common.gradle"

View File

@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.extension.pt.brmangas package eu.kanade.tachiyomi.extension.pt.brmangas
import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor
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.FilterList import eu.kanade.tachiyomi.source.model.FilterList
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
@ -27,7 +27,7 @@ class BrMangas : ParsedHttpSource() {
override val supportsLatest = true override val supportsLatest = true
override val client: OkHttpClient = network.cloudflareClient.newBuilder() override val client: OkHttpClient = network.cloudflareClient.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

@ -6,11 +6,7 @@ ext {
extName = 'Bruttal' extName = 'Bruttal'
pkgNameSuffix = 'pt.bruttal' pkgNameSuffix = 'pt.bruttal'
extClass = '.Bruttal' extClass = '.Bruttal'
extVersionCode = 4 extVersionCode = 5
}
dependencies {
implementation project(':lib-ratelimit')
} }
apply from: "$rootDir/common.gradle" apply from: "$rootDir/common.gradle"

View File

@ -1,8 +1,8 @@
package eu.kanade.tachiyomi.extension.pt.bruttal package eu.kanade.tachiyomi.extension.pt.bruttal
import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor
import eu.kanade.tachiyomi.network.GET import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.network.asObservableSuccess 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.FilterList
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
@ -30,7 +30,7 @@ class Bruttal : HttpSource() {
override val supportsLatest = false override val supportsLatest = false
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()
override fun headersBuilder(): Headers.Builder = Headers.Builder() override fun headersBuilder(): Headers.Builder = Headers.Builder()

View File

@ -5,12 +5,8 @@ ext {
extName = 'Golden Mangás' extName = 'Golden Mangás'
pkgNameSuffix = 'pt.goldenmangas' pkgNameSuffix = 'pt.goldenmangas'
extClass = '.GoldenMangas' extClass = '.GoldenMangas'
extVersionCode = 15 extVersionCode = 16
isNsfw = true isNsfw = true
} }
dependencies {
implementation project(':lib-ratelimit')
}
apply from: "$rootDir/common.gradle" apply from: "$rootDir/common.gradle"

View File

@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.extension.pt.goldenmangas package eu.kanade.tachiyomi.extension.pt.goldenmangas
import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor
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.FilterList import eu.kanade.tachiyomi.source.model.FilterList
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
@ -34,7 +34,7 @@ class GoldenMangas : ParsedHttpSource() {
.connectTimeout(1, TimeUnit.MINUTES) .connectTimeout(1, TimeUnit.MINUTES)
.readTimeout(1, TimeUnit.MINUTES) .readTimeout(1, TimeUnit.MINUTES)
.writeTimeout(1, TimeUnit.MINUTES) .writeTimeout(1, TimeUnit.MINUTES)
.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

@ -6,11 +6,7 @@ ext {
extName = 'HQ Now!' extName = 'HQ Now!'
pkgNameSuffix = 'pt.hqnow' pkgNameSuffix = 'pt.hqnow'
extClass = '.HQNow' extClass = '.HQNow'
extVersionCode = 5 extVersionCode = 6
}
dependencies {
implementation project(':lib-ratelimit')
} }
apply from: "$rootDir/common.gradle" apply from: "$rootDir/common.gradle"

View File

@ -1,9 +1,9 @@
package eu.kanade.tachiyomi.extension.pt.hqnow package eu.kanade.tachiyomi.extension.pt.hqnow
import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor
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.asObservableSuccess 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.FilterList
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
@ -39,7 +39,7 @@ class HQNow : HttpSource() {
override val supportsLatest = true override val supportsLatest = true
override val client: OkHttpClient = network.cloudflareClient.newBuilder() override val client: OkHttpClient = network.cloudflareClient.newBuilder()
.addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) .rateLimit(1, 2, TimeUnit.SECONDS)
.build() .build()
private val json: Json by injectLazy() private val json: Json by injectLazy()

View File

@ -6,12 +6,8 @@ ext {
extName = 'MangaVibe' extName = 'MangaVibe'
pkgNameSuffix = 'pt.mangavibe' pkgNameSuffix = 'pt.mangavibe'
extClass = '.MangaVibe' extClass = '.MangaVibe'
extVersionCode = 1 extVersionCode = 2
isNsfw = true isNsfw = true
} }
dependencies {
implementation project(':lib-ratelimit')
}
apply from: "$rootDir/common.gradle" apply from: "$rootDir/common.gradle"

View File

@ -1,8 +1,8 @@
package eu.kanade.tachiyomi.extension.pt.mangavibe package eu.kanade.tachiyomi.extension.pt.mangavibe
import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor
import eu.kanade.tachiyomi.network.GET import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.network.asObservableSuccess 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.FilterList
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
@ -39,7 +39,7 @@ class MangaVibe : HttpSource() {
override val supportsLatest = true override val supportsLatest = true
override val client: OkHttpClient = network.cloudflareClient.newBuilder() override val client: OkHttpClient = network.cloudflareClient.newBuilder()
.addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) .rateLimit(1, 2, TimeUnit.SECONDS)
.addInterceptor(::directoryCacheIntercept) .addInterceptor(::directoryCacheIntercept)
.build() .build()

View File

@ -6,13 +6,8 @@ ext {
extName = 'Muito Hentai' extName = 'Muito Hentai'
pkgNameSuffix = 'pt.muitohentai' pkgNameSuffix = 'pt.muitohentai'
extClass = '.MuitoHentai' extClass = '.MuitoHentai'
extVersionCode = 1 extVersionCode = 2
isNsfw = true isNsfw = true
} }
dependencies {
implementation project(':lib-ratelimit')
}
apply from: "$rootDir/common.gradle" apply from: "$rootDir/common.gradle"

View File

@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.extension.pt.muitohentai package eu.kanade.tachiyomi.extension.pt.muitohentai
import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor
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.FilterList import eu.kanade.tachiyomi.source.model.FilterList
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
@ -32,7 +32,7 @@ class MuitoHentai : ParsedHttpSource() {
override val supportsLatest = true override val supportsLatest = true
override val client: OkHttpClient = network.cloudflareClient.newBuilder() override val client: OkHttpClient = network.cloudflareClient.newBuilder()
.addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) .rateLimit(1, 2, TimeUnit.SECONDS)
.build() .build()
private val json: Json by injectLazy() private val json: Json by injectLazy()

View File

@ -6,12 +6,8 @@ ext {
extName = 'Muito Mangá' extName = 'Muito Mangá'
pkgNameSuffix = 'pt.muitomanga' pkgNameSuffix = 'pt.muitomanga'
extClass = '.MuitoManga' extClass = '.MuitoManga'
extVersionCode = 5 extVersionCode = 6
isNsfw = true isNsfw = true
} }
dependencies {
implementation project(':lib-ratelimit')
}
apply from: "$rootDir/common.gradle" apply from: "$rootDir/common.gradle"

View File

@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.extension.pt.muitomanga package eu.kanade.tachiyomi.extension.pt.muitomanga
import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor
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.FilterList import eu.kanade.tachiyomi.source.model.FilterList
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
@ -38,7 +38,7 @@ class MuitoManga : ParsedHttpSource() {
override val supportsLatest = true override val supportsLatest = true
override val client: OkHttpClient = network.cloudflareClient.newBuilder() override val client: OkHttpClient = network.cloudflareClient.newBuilder()
.addInterceptor(RateLimitInterceptor(1, 2, TimeUnit.SECONDS)) .rateLimit(1, 2, TimeUnit.SECONDS)
.addInterceptor(::directoryCacheIntercept) .addInterceptor(::directoryCacheIntercept)
.build() .build()

View File

@ -5,13 +5,8 @@ ext {
extName = 'Mundo Hentai' extName = 'Mundo Hentai'
pkgNameSuffix = 'pt.mundohentai' pkgNameSuffix = 'pt.mundohentai'
extClass = '.MundoHentai' extClass = '.MundoHentai'
extVersionCode = 3 extVersionCode = 4
isNsfw = true isNsfw = true
} }
dependencies {
implementation project(':lib-ratelimit')
}
apply from: "$rootDir/common.gradle" apply from: "$rootDir/common.gradle"

View File

@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.extension.pt.mundohentai package eu.kanade.tachiyomi.extension.pt.mundohentai
import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor
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.Filter import eu.kanade.tachiyomi.source.model.Filter
import eu.kanade.tachiyomi.source.model.FilterList import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.Page import eu.kanade.tachiyomi.source.model.Page
@ -27,7 +27,7 @@ class MundoHentai : ParsedHttpSource() {
override val supportsLatest = false override val supportsLatest = false
override val client: OkHttpClient = network.cloudflareClient.newBuilder() override val client: OkHttpClient = network.cloudflareClient.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

@ -6,12 +6,8 @@ ext {
extName = 'Mundo Mangá-Kun' extName = 'Mundo Mangá-Kun'
pkgNameSuffix = 'pt.mundomangakun' pkgNameSuffix = 'pt.mundomangakun'
extClass = '.MundoMangaKun' extClass = '.MundoMangaKun'
extVersionCode = 8 extVersionCode = 9
isNsfw = true isNsfw = true
} }
dependencies {
implementation project(':lib-ratelimit')
}
apply from: "$rootDir/common.gradle" apply from: "$rootDir/common.gradle"

View File

@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.extension.pt.mundomangakun package eu.kanade.tachiyomi.extension.pt.mundomangakun
import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor
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.Filter import eu.kanade.tachiyomi.source.model.Filter
import eu.kanade.tachiyomi.source.model.FilterList import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.Page import eu.kanade.tachiyomi.source.model.Page
@ -33,7 +33,7 @@ class MundoMangaKun : ParsedHttpSource() {
override val supportsLatest = false override val supportsLatest = false
override val client: OkHttpClient = network.client.newBuilder() override val client: OkHttpClient = network.client.newBuilder()
.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

@ -5,12 +5,8 @@ ext {
extName = 'Mundo Webtoon' extName = 'Mundo Webtoon'
pkgNameSuffix = 'pt.mundowebtoon' pkgNameSuffix = 'pt.mundowebtoon'
extClass = '.MundoWebtoon' extClass = '.MundoWebtoon'
extVersionCode = 5 extVersionCode = 6
isNsfw = true isNsfw = true
} }
dependencies {
implementation project(':lib-ratelimit')
}
apply from: "$rootDir/common.gradle" apply from: "$rootDir/common.gradle"

View File

@ -1,8 +1,8 @@
package eu.kanade.tachiyomi.extension.pt.mundowebtoon package eu.kanade.tachiyomi.extension.pt.mundowebtoon
import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor
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.interceptor.rateLimit
import eu.kanade.tachiyomi.source.model.FilterList import eu.kanade.tachiyomi.source.model.FilterList
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
@ -33,7 +33,7 @@ class MundoWebtoon : ParsedHttpSource() {
override val supportsLatest = true override val supportsLatest = true
override val client: OkHttpClient = network.cloudflareClient.newBuilder() override val client: OkHttpClient = network.cloudflareClient.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

@ -6,11 +6,7 @@ ext {
extName = 'One Piece Ex' extName = 'One Piece Ex'
pkgNameSuffix = 'pt.opex' pkgNameSuffix = 'pt.opex'
extClass = '.OnePieceEx' extClass = '.OnePieceEx'
extVersionCode = 4 extVersionCode = 5
}
dependencies {
implementation project(':lib-ratelimit')
} }
apply from: "$rootDir/common.gradle" apply from: "$rootDir/common.gradle"

View File

@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.extension.pt.opex package eu.kanade.tachiyomi.extension.pt.opex
import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor
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.FilterList import eu.kanade.tachiyomi.source.model.FilterList
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
@ -35,7 +35,7 @@ class OnePieceEx : ParsedHttpSource() {
override val supportsLatest = false override val supportsLatest = false
override val client: OkHttpClient = network.cloudflareClient.newBuilder() override val client: OkHttpClient = network.cloudflareClient.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

@ -6,11 +6,7 @@ ext {
extName = 'Saikai Scan' extName = 'Saikai Scan'
pkgNameSuffix = 'pt.saikaiscan' pkgNameSuffix = 'pt.saikaiscan'
extClass = '.SaikaiScan' extClass = '.SaikaiScan'
extVersionCode = 8 extVersionCode = 9
}
dependencies {
implementation project(':lib-ratelimit')
} }
apply from: "$rootDir/common.gradle" apply from: "$rootDir/common.gradle"

View File

@ -1,8 +1,8 @@
package eu.kanade.tachiyomi.extension.pt.saikaiscan package eu.kanade.tachiyomi.extension.pt.saikaiscan
import eu.kanade.tachiyomi.lib.ratelimit.SpecificHostRateLimitInterceptor
import eu.kanade.tachiyomi.network.GET import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.network.asObservableSuccess import eu.kanade.tachiyomi.network.asObservableSuccess
import eu.kanade.tachiyomi.network.interceptor.rateLimitHost
import eu.kanade.tachiyomi.source.model.FilterList import eu.kanade.tachiyomi.source.model.FilterList
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
@ -33,8 +33,8 @@ class SaikaiScan : HttpSource() {
override val supportsLatest = true override val supportsLatest = true
override val client: OkHttpClient = network.cloudflareClient.newBuilder() override val client: OkHttpClient = network.cloudflareClient.newBuilder()
.addInterceptor(SpecificHostRateLimitInterceptor(API_URL.toHttpUrl(), 1, 2)) .rateLimitHost(API_URL.toHttpUrl(), 1, 2)
.addInterceptor(SpecificHostRateLimitInterceptor(IMAGE_SERVER_URL.toHttpUrl(), 1, 1)) .rateLimitHost(IMAGE_SERVER_URL.toHttpUrl(), 1, 1)
.build() .build()
private val json: Json by injectLazy() private val json: Json by injectLazy()

View File

@ -6,12 +6,8 @@ ext {
extName = 'Tao Sect' extName = 'Tao Sect'
pkgNameSuffix = 'pt.taosect' pkgNameSuffix = 'pt.taosect'
extClass = '.TaoSect' extClass = '.TaoSect'
extVersionCode = 16 extVersionCode = 17
isNsfw = true isNsfw = true
} }
dependencies {
implementation project(':lib-ratelimit')
}
apply from: "$rootDir/common.gradle" apply from: "$rootDir/common.gradle"

View File

@ -1,9 +1,9 @@
package eu.kanade.tachiyomi.extension.pt.taosect package eu.kanade.tachiyomi.extension.pt.taosect
import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor
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.asObservableSuccess 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.FilterList
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
@ -37,7 +37,7 @@ class TaoSect : HttpSource() {
override val supportsLatest = true override val supportsLatest = true
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()
private val json: Json by injectLazy() private val json: Json by injectLazy()

View File

@ -5,12 +5,8 @@ ext {
extName = 'AllHentai' extName = 'AllHentai'
pkgNameSuffix = 'ru.allhentai' pkgNameSuffix = 'ru.allhentai'
extClass = '.AllHentai' extClass = '.AllHentai'
extVersionCode = 21 extVersionCode = 22
isNsfw = true isNsfw = true
} }
dependencies {
implementation project(':lib-ratelimit')
}
apply from: "$rootDir/common.gradle" apply from: "$rootDir/common.gradle"

View File

@ -3,9 +3,9 @@ package eu.kanade.tachiyomi.extension.ru.allhentai
import android.app.Application import android.app.Application
import android.content.SharedPreferences import android.content.SharedPreferences
import android.widget.Toast import android.widget.Toast
import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor
import eu.kanade.tachiyomi.network.GET import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.network.asObservableSuccess import eu.kanade.tachiyomi.network.asObservableSuccess
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.Filter import eu.kanade.tachiyomi.source.model.Filter
import eu.kanade.tachiyomi.source.model.FilterList import eu.kanade.tachiyomi.source.model.FilterList
@ -46,10 +46,8 @@ class AllHentai : ConfigurableSource, ParsedHttpSource() {
override val supportsLatest = true override val supportsLatest = true
private val rateLimitInterceptor = RateLimitInterceptor(2)
override val client: OkHttpClient = network.client.newBuilder() override val client: OkHttpClient = network.client.newBuilder()
.addNetworkInterceptor(rateLimitInterceptor) .rateLimit(2)
.addNetworkInterceptor { chain -> .addNetworkInterceptor { chain ->
val originalRequest = chain.request() val originalRequest = chain.request()
val response = chain.proceed(originalRequest) val response = chain.proceed(originalRequest)

View File

@ -6,11 +6,7 @@ ext {
extName = 'ComX' extName = 'ComX'
pkgNameSuffix = 'ru.comx' pkgNameSuffix = 'ru.comx'
extClass = '.ComX' extClass = '.ComX'
extVersionCode = 16 extVersionCode = 17
}
dependencies {
implementation project(':lib-ratelimit')
} }
apply from: "$rootDir/common.gradle" apply from: "$rootDir/common.gradle"

View File

@ -1,9 +1,9 @@
package eu.kanade.tachiyomi.extension.ru.comx package eu.kanade.tachiyomi.extension.ru.comx
import android.webkit.CookieManager import android.webkit.CookieManager
import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor
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.interceptor.rateLimit
import eu.kanade.tachiyomi.source.model.FilterList import eu.kanade.tachiyomi.source.model.FilterList
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
@ -48,7 +48,7 @@ class ComX : ParsedHttpSource() {
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(3)) .rateLimit(3)
.addNetworkInterceptor { chain -> .addNetworkInterceptor { chain ->
val originalRequest = chain.request() val originalRequest = chain.request()
val response = chain.proceed(originalRequest) val response = chain.proceed(originalRequest)

View File

@ -6,12 +6,8 @@ ext {
extName = 'Henchan' extName = 'Henchan'
pkgNameSuffix = 'ru.henchan' pkgNameSuffix = 'ru.henchan'
extClass = '.Henchan' extClass = '.Henchan'
extVersionCode = 34 extVersionCode = 35
isNsfw = true isNsfw = true
} }
dependencies {
implementation project(':lib-ratelimit')
}
apply from: "$rootDir/common.gradle" apply from: "$rootDir/common.gradle"

View File

@ -1,9 +1,9 @@
package eu.kanade.tachiyomi.extension.ru.henchan package eu.kanade.tachiyomi.extension.ru.henchan
import android.annotation.SuppressLint import android.annotation.SuppressLint
import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor
import eu.kanade.tachiyomi.network.GET import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.network.asObservable import eu.kanade.tachiyomi.network.asObservable
import eu.kanade.tachiyomi.network.interceptor.rateLimit
import eu.kanade.tachiyomi.source.model.Filter import eu.kanade.tachiyomi.source.model.Filter
import eu.kanade.tachiyomi.source.model.FilterList import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.Page import eu.kanade.tachiyomi.source.model.Page
@ -33,10 +33,9 @@ class Henchan : ParsedHttpSource() {
override val supportsLatest = true override val supportsLatest = true
private val rateLimitInterceptor = RateLimitInterceptor(2)
override val client: OkHttpClient = network.client.newBuilder() override val client: OkHttpClient = network.client.newBuilder()
.addNetworkInterceptor(rateLimitInterceptor).build() .rateLimit(2)
.build()
override fun popularMangaRequest(page: Int): Request = override fun popularMangaRequest(page: Int): Request =
GET("$baseUrl/mostfavorites&sort=manga?offset=${20 * (page - 1)}", headers) GET("$baseUrl/mostfavorites&sort=manga?offset=${20 * (page - 1)}", headers)

View File

@ -6,12 +6,8 @@ ext {
extName = 'HentaiLib' extName = 'HentaiLib'
pkgNameSuffix = 'ru.libhentai' pkgNameSuffix = 'ru.libhentai'
extClass = '.LibHentai' extClass = '.LibHentai'
extVersionCode = 17 extVersionCode = 18
isNsfw = true isNsfw = true
} }
dependencies {
implementation project(path: ':lib-ratelimit')
}
apply from: "$rootDir/common.gradle" apply from: "$rootDir/common.gradle"

View File

@ -5,11 +5,11 @@ import android.content.SharedPreferences
import android.widget.Toast import android.widget.Toast
import androidx.preference.ListPreference import androidx.preference.ListPreference
import androidx.preference.PreferenceScreen import androidx.preference.PreferenceScreen
import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor
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.asObservableSuccess import eu.kanade.tachiyomi.network.asObservableSuccess
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.Filter import eu.kanade.tachiyomi.source.model.Filter
import eu.kanade.tachiyomi.source.model.FilterList import eu.kanade.tachiyomi.source.model.FilterList
@ -85,7 +85,7 @@ class LibHentai : ConfigurableSource, HttpSource() {
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(3)) .rateLimit(3)
.addInterceptor { imageContentTypeIntercept(it) } .addInterceptor { imageContentTypeIntercept(it) }
.addInterceptor { chain -> .addInterceptor { chain ->
val originalRequest = chain.request() val originalRequest = chain.request()

View File

@ -6,11 +6,7 @@ ext {
extName = 'MangaLib' extName = 'MangaLib'
pkgNameSuffix = 'ru.libmanga' pkgNameSuffix = 'ru.libmanga'
extClass = '.LibManga' extClass = '.LibManga'
extVersionCode = 72 extVersionCode = 73
}
dependencies {
implementation project(path: ':lib-ratelimit')
} }
apply from: "$rootDir/common.gradle" apply from: "$rootDir/common.gradle"

View File

@ -5,11 +5,11 @@ import android.content.SharedPreferences
import android.widget.Toast import android.widget.Toast
import androidx.preference.ListPreference import androidx.preference.ListPreference
import androidx.preference.PreferenceScreen import androidx.preference.PreferenceScreen
import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor
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.asObservableSuccess import eu.kanade.tachiyomi.network.asObservableSuccess
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.Filter import eu.kanade.tachiyomi.source.model.Filter
import eu.kanade.tachiyomi.source.model.FilterList import eu.kanade.tachiyomi.source.model.FilterList
@ -74,7 +74,7 @@ class LibManga : ConfigurableSource, HttpSource() {
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(3)) .rateLimit(3)
.addInterceptor { imageContentTypeIntercept(it) } .addInterceptor { imageContentTypeIntercept(it) }
.build() .build()

View File

@ -5,11 +5,7 @@ ext {
extName = 'Mangachan' extName = 'Mangachan'
pkgNameSuffix = 'ru.mangachan' pkgNameSuffix = 'ru.mangachan'
extClass = '.Mangachan' extClass = '.Mangachan'
extVersionCode = 12 extVersionCode = 13
}
dependencies {
implementation project(':lib-ratelimit')
} }
apply from: "$rootDir/common.gradle" apply from: "$rootDir/common.gradle"

View File

@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.extension.ru.mangachan package eu.kanade.tachiyomi.extension.ru.mangachan
import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor
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.Filter import eu.kanade.tachiyomi.source.model.Filter
import eu.kanade.tachiyomi.source.model.FilterList import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.MangasPage import eu.kanade.tachiyomi.source.model.MangasPage
@ -30,10 +30,9 @@ class Mangachan : ParsedHttpSource() {
override val supportsLatest = false override val supportsLatest = false
private val rateLimitInterceptor = RateLimitInterceptor(2)
override val client: OkHttpClient = network.client.newBuilder() override val client: OkHttpClient = network.client.newBuilder()
.addNetworkInterceptor(rateLimitInterceptor).build() .rateLimit(2)
.build()
override fun popularMangaRequest(page: Int): Request = override fun popularMangaRequest(page: Int): Request =
GET("$baseUrl/mostfavorites?offset=${20 * (page - 1)}", headers) GET("$baseUrl/mostfavorites?offset=${20 * (page - 1)}", headers)

View File

@ -6,11 +6,7 @@ ext {
extName = 'Mangahub' extName = 'Mangahub'
pkgNameSuffix = 'ru.mangahub' pkgNameSuffix = 'ru.mangahub'
extClass = '.Mangahub' extClass = '.Mangahub'
extVersionCode = 14 extVersionCode = 15
}
dependencies {
implementation project(':lib-ratelimit')
} }
apply from: "$rootDir/common.gradle" apply from: "$rootDir/common.gradle"

View File

@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.extension.ru.mangahub package eu.kanade.tachiyomi.extension.ru.mangahub
import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor
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.FilterList import eu.kanade.tachiyomi.source.model.FilterList
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
@ -31,7 +31,7 @@ open class Mangahub : ParsedHttpSource() {
override val supportsLatest = true override val supportsLatest = true
override val client: OkHttpClient = network.client.newBuilder() override val client: OkHttpClient = network.client.newBuilder()
.addNetworkInterceptor(RateLimitInterceptor(2)) .rateLimit(2)
.build() .build()
private val json: Json by injectLazy() private val json: Json by injectLazy()

View File

@ -5,11 +5,7 @@ ext {
extName = 'Mintmanga' extName = 'Mintmanga'
pkgNameSuffix = 'ru.mintmanga' pkgNameSuffix = 'ru.mintmanga'
extClass = '.Mintmanga' extClass = '.Mintmanga'
extVersionCode = 44 extVersionCode = 45
}
dependencies {
implementation project(':lib-ratelimit')
} }
apply from: "$rootDir/common.gradle" apply from: "$rootDir/common.gradle"

View File

@ -3,9 +3,9 @@ package eu.kanade.tachiyomi.extension.ru.mintmanga
import android.app.Application import android.app.Application
import android.content.SharedPreferences import android.content.SharedPreferences
import android.widget.Toast import android.widget.Toast
import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor
import eu.kanade.tachiyomi.network.GET import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.network.asObservableSuccess import eu.kanade.tachiyomi.network.asObservableSuccess
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.Filter import eu.kanade.tachiyomi.source.model.Filter
import eu.kanade.tachiyomi.source.model.FilterList import eu.kanade.tachiyomi.source.model.FilterList
@ -46,10 +46,8 @@ class Mintmanga : ConfigurableSource, ParsedHttpSource() {
override val supportsLatest = true override val supportsLatest = true
private val rateLimitInterceptor = RateLimitInterceptor(2)
override val client: OkHttpClient = network.client.newBuilder() override val client: OkHttpClient = network.client.newBuilder()
.addNetworkInterceptor(rateLimitInterceptor) .rateLimit(2)
.addNetworkInterceptor { chain -> .addNetworkInterceptor { chain ->
val originalRequest = chain.request() val originalRequest = chain.request()
val response = chain.proceed(originalRequest) val response = chain.proceed(originalRequest)

View File

@ -5,11 +5,7 @@ ext {
extName = 'Readmanga' extName = 'Readmanga'
pkgNameSuffix = 'ru.readmanga' pkgNameSuffix = 'ru.readmanga'
extClass = '.Readmanga' extClass = '.Readmanga'
extVersionCode = 43 extVersionCode = 44
}
dependencies {
implementation project(':lib-ratelimit')
} }
apply from: "$rootDir/common.gradle" apply from: "$rootDir/common.gradle"

View File

@ -3,9 +3,9 @@ package eu.kanade.tachiyomi.extension.ru.readmanga
import android.app.Application import android.app.Application
import android.content.SharedPreferences import android.content.SharedPreferences
import android.widget.Toast import android.widget.Toast
import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor
import eu.kanade.tachiyomi.network.GET import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.network.asObservableSuccess import eu.kanade.tachiyomi.network.asObservableSuccess
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.Filter import eu.kanade.tachiyomi.source.model.Filter
import eu.kanade.tachiyomi.source.model.FilterList import eu.kanade.tachiyomi.source.model.FilterList
@ -46,10 +46,8 @@ class Readmanga : ConfigurableSource, ParsedHttpSource() {
override val supportsLatest = true override val supportsLatest = true
private val rateLimitInterceptor = RateLimitInterceptor(2)
override val client: OkHttpClient = network.client.newBuilder() override val client: OkHttpClient = network.client.newBuilder()
.addNetworkInterceptor(rateLimitInterceptor) .rateLimit(2)
.addNetworkInterceptor { chain -> .addNetworkInterceptor { chain ->
val originalRequest = chain.request() val originalRequest = chain.request()
val response = chain.proceed(originalRequest) val response = chain.proceed(originalRequest)

View File

@ -5,11 +5,7 @@ ext {
extName = 'Selfmanga' extName = 'Selfmanga'
pkgNameSuffix = 'ru.selfmanga' pkgNameSuffix = 'ru.selfmanga'
extClass = '.Selfmanga' extClass = '.Selfmanga'
extVersionCode = 21 extVersionCode = 22
}
dependencies {
implementation project(':lib-ratelimit')
} }
apply from: "$rootDir/common.gradle" apply from: "$rootDir/common.gradle"

View File

@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.extension.ru.selfmanga package eu.kanade.tachiyomi.extension.ru.selfmanga
import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor
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.Filter import eu.kanade.tachiyomi.source.model.Filter
import eu.kanade.tachiyomi.source.model.FilterList import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.Page import eu.kanade.tachiyomi.source.model.Page
@ -32,10 +32,8 @@ class Selfmanga : ParsedHttpSource() {
override val supportsLatest = true override val supportsLatest = true
private val rateLimitInterceptor = RateLimitInterceptor(2)
override val client: OkHttpClient = network.client.newBuilder() override val client: OkHttpClient = network.client.newBuilder()
.addNetworkInterceptor(rateLimitInterceptor) .rateLimit(2)
.addNetworkInterceptor { chain -> .addNetworkInterceptor { chain ->
val originalRequest = chain.request() val originalRequest = chain.request()
val response = chain.proceed(originalRequest) val response = chain.proceed(originalRequest)

View File

@ -6,11 +6,7 @@ ext {
extName = 'UniComics' extName = 'UniComics'
pkgNameSuffix = 'ru.unicomics' pkgNameSuffix = 'ru.unicomics'
extClass = '.UniComics' extClass = '.UniComics'
extVersionCode = 4 extVersionCode = 5
}
dependencies {
implementation project(':lib-ratelimit')
} }
apply from: "$rootDir/common.gradle" apply from: "$rootDir/common.gradle"

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