DynastyScans: Add ratelimit (#3218)

add ratelimit
This commit is contained in:
bapeey 2024-05-25 05:30:31 -05:00 committed by GitHub
parent b94ef0e124
commit 63a373f9e8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 1 deletions

View File

@ -1,7 +1,7 @@
ext {
extName = 'Dynasty'
extClass = '.DynastyFactory'
extVersionCode = 23
extVersionCode = 24
}
apply from: "$rootDir/common.gradle"

View File

@ -3,6 +3,7 @@ package eu.kanade.tachiyomi.extension.en.dynasty
import android.net.Uri
import eu.kanade.tachiyomi.network.GET
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.MangasPage
import eu.kanade.tachiyomi.source.model.Page
@ -14,6 +15,7 @@ import kotlinx.serialization.json.Json
import kotlinx.serialization.json.jsonArray
import kotlinx.serialization.json.jsonObject
import kotlinx.serialization.json.jsonPrimitive
import okhttp3.HttpUrl.Companion.toHttpUrl
import okhttp3.Request
import okhttp3.Response
import org.jsoup.nodes.Document
@ -26,11 +28,16 @@ import uy.kohesive.injekt.injectLazy
import java.text.SimpleDateFormat
import java.util.ArrayList
import java.util.Locale
import java.util.concurrent.TimeUnit
abstract class DynastyScans : ParsedHttpSource() {
override val baseUrl = "https://dynasty-scans.com"
override val client = network.cloudflareClient.newBuilder()
.rateLimitHost(baseUrl.toHttpUrl(), 1, 1, TimeUnit.SECONDS)
.build()
abstract fun popularMangaInitialUrl(): String
override val lang = "en"