Sushi-Scan: Add rate limit (#18794)

This commit is contained in:
KirinRaikage 2023-10-30 21:06:31 +01:00 committed by GitHub
parent d69961b25b
commit f2cc705cb7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 1 deletions

View File

@ -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"

View File

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