Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explicit cloudflareClient if Cloudflare hosted #6613

Merged
merged 2 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib-multisrc/blogtruyen/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ plugins {
id("lib-multisrc")
}

baseVersionCode = 3
baseVersionCode = 4
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ abstract class BlogTruyen(

override val supportsLatest = true

override val client = network.cloudflareClient

override fun headersBuilder() = super.headersBuilder()
.add("Referer", "$baseUrl/")

Expand Down
2 changes: 1 addition & 1 deletion lib-multisrc/mangahub/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ plugins {
id("lib-multisrc")
}

baseVersionCode = 28
baseVersionCode = 29

dependencies {
api(project(":lib:randomua"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ abstract class MangaHub(
private var baseApiUrl = "https://api.mghcdn.com"
private var baseCdnUrl = "https://imgx.mghcdn.com"

override val client: OkHttpClient = super.client.newBuilder()
override val client: OkHttpClient = network.cloudflareClient.newBuilder()
.setRandomUserAgent(
userAgentType = UserAgentType.DESKTOP,
filterInclude = listOf("chrome"),
Expand Down
2 changes: 1 addition & 1 deletion lib-multisrc/mmrcms/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ plugins {
id("lib-multisrc")
}

baseVersionCode = 11
baseVersionCode = 12

dependencies {
api(project(":lib:i18n"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ constructor(

override val supportsLatest = true

override val client = network.cloudflareClient

override fun headersBuilder() = super.headersBuilder()
.add("Referer", "$baseUrl/")

Expand Down
2 changes: 1 addition & 1 deletion lib-multisrc/pizzareader/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ plugins {
id("lib-multisrc")
}

baseVersionCode = 2
baseVersionCode = 3
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ abstract class PizzaReader(

override val supportsLatest = true

override val client = network.cloudflareClient

open val apiUrl by lazy { "$baseUrl$apiPath" }

protected open val json: Json by injectLazy()
Expand Down
2 changes: 1 addition & 1 deletion lib-multisrc/zeistmanga/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ plugins {
id("lib-multisrc")
}

baseVersionCode = 9
baseVersionCode = 10
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ abstract class ZeistManga(

override val supportsLatest = true

override val client = network.cloudflareClient

protected val json: Json by injectLazy()

private val intl by lazy { ZeistMangaIntl(lang) }
Expand Down
2 changes: 1 addition & 1 deletion src/all/cubari/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ext {
extName = 'Cubari'
extClass = '.CubariFactory'
extVersionCode = 24
extVersionCode = 25
}

apply from: "$rootDir/common.gradle"
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ open class Cubari(override val lang: String) : HttpSource() {

private val json: Json by injectLazy()

override val client = super.client.newBuilder()
override val client = network.cloudflareClient.newBuilder()
.addInterceptor { chain ->
val request = chain.request()
val headers = request.headers.newBuilder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ abstract class MangaForFree(
lang: String,
) : Madara(name, baseUrl, lang) {

override val client: OkHttpClient = super.client.newBuilder()
override val client: OkHttpClient = network.cloudflareClient.newBuilder()
.rateLimit(1, 1, TimeUnit.SECONDS)
.build()
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import uy.kohesive.injekt.api.get

class HentaiSlayer : FuzzyDoodle("هنتاي سلاير", "https://hentaislayer.net", "ar"), ConfigurableSource {

override val client = super.client.newBuilder()
override val client = network.cloudflareClient.newBuilder()
.rateLimit(2)
.build()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class MangaSwat :
Injekt.get<Application>().getSharedPreferences("source_$id", 0x0000)
}

override val client = super.client.newBuilder()
override val client = network.cloudflareClient.newBuilder()
.addInterceptor(::tokenInterceptor)
.rateLimit(1)
.build()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class YonaBar : Madara(
"ar",
SimpleDateFormat("MMM dd, yyyy", Locale("ar")),
) {
override val client = super.client.newBuilder()
override val client = network.cloudflareClient.newBuilder()
.rateLimit(3)
.build()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class AnisaScans : Madara(
"https://anisascans.in",
"en",
) {
override val client = super.client.newBuilder()
override val client = network.cloudflareClient.newBuilder()
.rateLimit(3)
.build()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class AstraScans : MangaThemesia(
"en",
"/series",
) {
override val client = super.client.newBuilder()
override val client = network.cloudflareClient.newBuilder()
.rateLimit(3)
.build()
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class Manhuagold : Liliana(
// MangaReader -> Liliana
override val versionId = 2

override val client = super.client.newBuilder()
override val client = network.cloudflareClient.newBuilder()
.rateLimit(2)
.build()
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class CulturedWorks : MangaThemesia(
"https://culturedworks.com",
"en",
) {
override val client = super.client.newBuilder()
override val client = network.cloudflareClient.newBuilder()
.rateLimit(2)
.build()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import okhttp3.OkHttpClient

class DarkScans : Madara("Dark Scans", "https://darkscans.net", "en") {

override val client: OkHttpClient = super.client.newBuilder()
override val client: OkHttpClient = network.cloudflareClient.newBuilder()
.rateLimit(20, 4)
.build()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class DragonTea : Madara(
"en",
dateFormat = SimpleDateFormat("MM/dd/yyyy", Locale.US),
) {
override val client: OkHttpClient = super.client.newBuilder()
override val client: OkHttpClient = network.cloudflareClient.newBuilder()
.rateLimit(1)
.build()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class DrakeScans : MangaThemesia(
// madara -> mangathemesia
override val versionId = 2

override val client = super.client.newBuilder()
override val client = network.cloudflareClient.newBuilder()
.rateLimitHost(baseUrl.toHttpUrl(), 3, 1, TimeUnit.SECONDS)
.build()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class ErosScans : MangaThemesia(
"https://tercoscans.xyz",
"en",
) {
override val client = super.client.newBuilder()
override val client = network.cloudflareClient.newBuilder()
.rateLimit(3)
.build()
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class FirstKissManhua : Madara(
"https://1stkissmanhua.net",
"en",
) {
override val client = super.client.newBuilder()
override val client = network.cloudflareClient.newBuilder()
.rateLimit(3)
.build()

Expand Down
2 changes: 1 addition & 1 deletion src/en/flamecomics/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ext {
extName = 'Flame Comics'
extClass = '.FlameComics'
extVersionCode = 37
extVersionCode = 38
}

apply from: "$rootDir/common.gradle"
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class FlameComics : HttpSource() {

private val json: Json by injectLazy()

override val client = super.client.newBuilder()
override val client = network.cloudflareClient.newBuilder()
.rateLimit(2, 7)
.addInterceptor(::buildIdOutdatedInterceptor)
.addInterceptor(::composedImageIntercept)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import java.util.concurrent.TimeUnit

class FreeManga : Madara("Free Manga", "https://freemanga.me", "en") {

override val client: OkHttpClient = super.client.newBuilder()
override val client: OkHttpClient = network.cloudflareClient.newBuilder()
.rateLimit(1, 1, TimeUnit.SECONDS)
.build()
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class Harimanga : Madara(
"https://harimanga.me",
"en",
) {
override val client = super.client.newBuilder()
override val client = network.cloudflareClient.newBuilder()
.rateLimit(3)
.build()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import okhttp3.OkHttpClient

class Hentai20 : MangaThemesia("Hentai20", "https://hentai20.io", "en") {

override val client: OkHttpClient = super.client.newBuilder()
override val client: OkHttpClient = network.cloudflareClient.newBuilder()
.rateLimit(1)
.build()
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class Hentairead : Madara("HentaiRead", "https://hentairead.com", "en", dateForm
.add("Accept", "image/avif,image/webp,image/apng,image/svg+xml,image/*,*/*;q=0.8")
.build()

override val client = super.client.newBuilder()
override val client = network.cloudflareClient.newBuilder()
.addInterceptor { chain ->
val request = chain.request()
val url = request.url.toString()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class Hiperdex :

override val baseUrl by lazy { getPrefBaseUrl() }

override val client = super.client.newBuilder()
override val client = network.cloudflareClient.newBuilder()
.setRandomUserAgent(
preferences.getPrefUAType(),
preferences.getPrefCustomUA(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class InfernalVoidScans : MangaThemesia(
"https://hivetoon.com",
"en",
) {
override val client = super.client.newBuilder()
override val client = network.cloudflareClient.newBuilder()
.addInterceptor { chain ->
val request = chain.request()
val headers = request.headers.newBuilder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class IrisScans : MangaThemesia(
"https://irisscans.xyz",
"en",
) {
override val client: OkHttpClient = super.client.newBuilder()
override val client: OkHttpClient = network.cloudflareClient.newBuilder()
.rateLimit(4)
.build()
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import eu.kanade.tachiyomi.multisrc.mangathemesia.MangaThemesia
import eu.kanade.tachiyomi.network.interceptor.rateLimit

class LuaScans : MangaThemesia("Lua Scans (unoriginal)", "https://ponvi.online", "en") {
override val client = super.client.newBuilder()
override val client = network.cloudflareClient.newBuilder()
.rateLimit(2)
.build()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class KappaBeast : MangaThemesia(
"https://kappabeast.com",
"en",
) {
override val client = super.client.newBuilder()
override val client = network.cloudflareClient.newBuilder()
.rateLimit(3)
.build()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class LunarScans :

private val preferences = Injekt.get<Application>().getSharedPreferences("source_$id", 0x0000)

override val client = super.client.newBuilder()
override val client = network.cloudflareClient.newBuilder()
.setRandomUserAgent(
preferences.getPrefUAType(),
preferences.getPrefCustomUA(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import eu.kanade.tachiyomi.multisrc.madara.Madara
import java.util.concurrent.TimeUnit

class Manga18x : Madara("Manga 18x", "https://manga18x.net", "en") {
override val client = super.client.newBuilder()
override val client = network.cloudflareClient.newBuilder()
.readTimeout(2, TimeUnit.MINUTES)
.build()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class MangaClash : Madara(
dateFormat = SimpleDateFormat("MM/dd/yy", Locale.US),
) {

override val client: OkHttpClient = super.client.newBuilder()
override val client: OkHttpClient = network.cloudflareClient.newBuilder()
.rateLimit(1, 1, TimeUnit.SECONDS)
.build()
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class MangaKomi : Madara(
"en",
) {

override val client: OkHttpClient = super.client.newBuilder()
override val client: OkHttpClient = network.cloudflareClient.newBuilder()
.rateLimit(1, 1, TimeUnit.SECONDS)
.build()
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class MangaSect : Liliana(
"en",
usesPostSearch = true,
) {
override val client = super.client.newBuilder()
override val client = network.cloudflareClient.newBuilder()
.rateLimit(1)
.build()
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class MangaTX : MangaThemesia(
mangaUrlDirectory = "/manga-list",
dateFormat = SimpleDateFormat("dd-MM-yyyy", Locale.ROOT),
) {
override val client = super.client.newBuilder()
override val client = network.cloudflareClient.newBuilder()
.rateLimit(3)
.build()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import java.util.concurrent.TimeUnit

class ManhuaFast : Madara("ManhuaFast", "https://manhuafast.com", "en") {

override val client: OkHttpClient = super.client.newBuilder()
override val client: OkHttpClient = network.cloudflareClient.newBuilder()
.rateLimit(20, 4, TimeUnit.SECONDS)
.build()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import eu.kanade.tachiyomi.multisrc.madara.Madara
import okhttp3.OkHttpClient

class Manhuaga : Madara("Manhuaga", "https://manhuaga.com", "en") {
override val client: OkHttpClient = super.client.newBuilder()
override val client: OkHttpClient = network.cloudflareClient.newBuilder()
.addInterceptor { chain ->
val originalRequest = chain.request()
chain.proceed(originalRequest).let { response ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class ManhwaFreake : MangaThemesia(
"en",
mangaUrlDirectory = "/series",
) {
override val client = super.client.newBuilder()
override val client = network.cloudflareClient.newBuilder()
.rateLimit(3)
.build()
}
Loading
Loading