Sushi-Scan: Add rate limit (#18794)
This commit is contained in:
parent
d69961b25b
commit
f2cc705cb7
|
@ -1,15 +1,27 @@
|
||||||
package eu.kanade.tachiyomi.extension.fr.sushiscan
|
package eu.kanade.tachiyomi.extension.fr.sushiscan
|
||||||
|
|
||||||
import eu.kanade.tachiyomi.multisrc.mangathemesia.MangaThemesia
|
import eu.kanade.tachiyomi.multisrc.mangathemesia.MangaThemesia
|
||||||
|
import eu.kanade.tachiyomi.network.interceptor.rateLimit
|
||||||
import eu.kanade.tachiyomi.source.model.Page
|
import eu.kanade.tachiyomi.source.model.Page
|
||||||
import eu.kanade.tachiyomi.source.model.SManga
|
import eu.kanade.tachiyomi.source.model.SManga
|
||||||
import kotlinx.serialization.Serializable
|
import kotlinx.serialization.Serializable
|
||||||
import kotlinx.serialization.decodeFromString
|
import kotlinx.serialization.decodeFromString
|
||||||
|
import okhttp3.Headers
|
||||||
|
import okhttp3.OkHttpClient
|
||||||
import org.jsoup.nodes.Document
|
import org.jsoup.nodes.Document
|
||||||
import java.text.SimpleDateFormat
|
import java.text.SimpleDateFormat
|
||||||
import java.util.Locale
|
import java.util.Locale
|
||||||
|
import java.util.concurrent.TimeUnit
|
||||||
|
|
||||||
class SushiScan : MangaThemesia("Sushi-Scan", "https://sushiscan.net", "fr", mangaUrlDirectory = "/catalogue", dateFormat = SimpleDateFormat("MMMM dd, yyyy", Locale.FRENCH)) {
|
class SushiScan : MangaThemesia("Sushi-Scan", "https://sushiscan.net", "fr", mangaUrlDirectory = "/catalogue", dateFormat = SimpleDateFormat("MMMM dd, yyyy", Locale.FRENCH)) {
|
||||||
|
|
||||||
|
override val client: OkHttpClient = super.client.newBuilder()
|
||||||
|
.rateLimit(2, 1, TimeUnit.SECONDS)
|
||||||
|
.build()
|
||||||
|
|
||||||
|
override fun headersBuilder(): Headers.Builder = super.headersBuilder()
|
||||||
|
.set("Referer", "$baseUrl$mangaUrlDirectory")
|
||||||
|
|
||||||
override val altNamePrefix = "Nom alternatif : "
|
override val altNamePrefix = "Nom alternatif : "
|
||||||
override val seriesAuthorSelector = ".imptdt:contains(Auteur) i, .fmed b:contains(Auteur)+span"
|
override val seriesAuthorSelector = ".imptdt:contains(Auteur) i, .fmed b:contains(Auteur)+span"
|
||||||
override val seriesStatusSelector = ".imptdt:contains(Statut) i"
|
override val seriesStatusSelector = ".imptdt:contains(Statut) i"
|
||||||
|
|
|
@ -133,7 +133,7 @@ class MangaThemesiaGenerator : ThemeSourceGenerator {
|
||||||
SingleLang("Summer Fansub", "https://smmr.in", "pt-BR", isNsfw = true),
|
SingleLang("Summer Fansub", "https://smmr.in", "pt-BR", isNsfw = true),
|
||||||
SingleLang("SummerToon", "https://summertoon.com", "tr"),
|
SingleLang("SummerToon", "https://summertoon.com", "tr"),
|
||||||
SingleLang("Surya Scans", "https://suryareader.com", "en", overrideVersionCode = 1),
|
SingleLang("Surya Scans", "https://suryareader.com", "en", overrideVersionCode = 1),
|
||||||
SingleLang("Sushi-Scan", "https://sushiscan.net", "fr", className = "SushiScan", overrideVersionCode = 8),
|
SingleLang("Sushi-Scan", "https://sushiscan.net", "fr", className = "SushiScan", overrideVersionCode = 9),
|
||||||
SingleLang("Sushiscan.fr", "https://sushiscan.fr", "fr", className = "SushiScanFR"),
|
SingleLang("Sushiscan.fr", "https://sushiscan.fr", "fr", className = "SushiScanFR"),
|
||||||
SingleLang("Tarot Scans", "https://www.tarotscans.com", "tr"),
|
SingleLang("Tarot Scans", "https://www.tarotscans.com", "tr"),
|
||||||
SingleLang("Tecno Scan", "https://tecnoscann.com", "es", isNsfw = true, overrideVersionCode = 6),
|
SingleLang("Tecno Scan", "https://tecnoscann.com", "es", isNsfw = true, overrideVersionCode = 6),
|
||||||
|
|
Loading…
Reference in New Issue