Explicit cloudflareClient if Cloudflare hosted (#6613)
* Explicit cloudflareClient if Cloudflare hosted * avoid modifying multisrc sources
This commit is contained in:
parent
c432620356
commit
8b212ffdcd
|
@ -2,4 +2,4 @@ plugins {
|
|||
id("lib-multisrc")
|
||||
}
|
||||
|
||||
baseVersionCode = 3
|
||||
baseVersionCode = 4
|
||||
|
|
|
@ -37,6 +37,8 @@ abstract class BlogTruyen(
|
|||
|
||||
override val supportsLatest = true
|
||||
|
||||
override val client = network.cloudflareClient
|
||||
|
||||
override fun headersBuilder() = super.headersBuilder()
|
||||
.add("Referer", "$baseUrl/")
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ plugins {
|
|||
id("lib-multisrc")
|
||||
}
|
||||
|
||||
baseVersionCode = 28
|
||||
baseVersionCode = 29
|
||||
|
||||
dependencies {
|
||||
api(project(":lib:randomua"))
|
||||
|
|
|
@ -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"),
|
||||
|
|
|
@ -2,7 +2,7 @@ plugins {
|
|||
id("lib-multisrc")
|
||||
}
|
||||
|
||||
baseVersionCode = 11
|
||||
baseVersionCode = 12
|
||||
|
||||
dependencies {
|
||||
api(project(":lib:i18n"))
|
||||
|
|
|
@ -67,6 +67,8 @@ constructor(
|
|||
|
||||
override val supportsLatest = true
|
||||
|
||||
override val client = network.cloudflareClient
|
||||
|
||||
override fun headersBuilder() = super.headersBuilder()
|
||||
.add("Referer", "$baseUrl/")
|
||||
|
||||
|
|
|
@ -2,4 +2,4 @@ plugins {
|
|||
id("lib-multisrc")
|
||||
}
|
||||
|
||||
baseVersionCode = 2
|
||||
baseVersionCode = 3
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -2,4 +2,4 @@ plugins {
|
|||
id("lib-multisrc")
|
||||
}
|
||||
|
||||
baseVersionCode = 9
|
||||
baseVersionCode = 10
|
||||
|
|
|
@ -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) }
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
ext {
|
||||
extName = 'Cubari'
|
||||
extClass = '.CubariFactory'
|
||||
extVersionCode = 24
|
||||
extVersionCode = 25
|
||||
}
|
||||
|
||||
apply from: "$rootDir/common.gradle"
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
ext {
|
||||
extName = 'Flame Comics'
|
||||
extClass = '.FlameComics'
|
||||
extVersionCode = 37
|
||||
extVersionCode = 38
|
||||
}
|
||||
|
||||
apply from: "$rootDir/common.gradle"
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
ext {
|
||||
extName = 'Olympus Scanlation'
|
||||
extClass = '.OlympusScanlation'
|
||||
extVersionCode = 11
|
||||
extVersionCode = 12
|
||||
}
|
||||
|
||||
apply from: "$rootDir/common.gradle"
|
||||
|
|
|
@ -32,7 +32,7 @@ class OlympusScanlation : HttpSource() {
|
|||
|
||||
override val supportsLatest: Boolean = true
|
||||
|
||||
override val client = super.client.newBuilder()
|
||||
override val client = network.cloudflareClient.newBuilder()
|
||||
.rateLimitHost(baseUrl.toHttpUrl(), 1, 2)
|
||||
.rateLimitHost(apiBaseUrl.toHttpUrl(), 2, 1)
|
||||
.build()
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
ext {
|
||||
extName = 'TMOHentai'
|
||||
extClass = '.TMOHentai'
|
||||
extVersionCode = 8
|
||||
extVersionCode = 9
|
||||
isNsfw = true
|
||||
}
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ class TMOHentai : ConfigurableSource, ParsedHttpSource() {
|
|||
|
||||
override val supportsLatest = true
|
||||
|
||||
override val client: OkHttpClient = super.client.newBuilder()
|
||||
override val client: OkHttpClient = network.cloudflareClient.newBuilder()
|
||||
.rateLimitHost(baseUrl.toHttpUrl(), 1, 2)
|
||||
.build()
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
ext {
|
||||
extName = 'HentaiArchive'
|
||||
extClass = '.HentaiArchive'
|
||||
extVersionCode = 1
|
||||
extVersionCode = 2
|
||||
isNsfw = true
|
||||
}
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ class HentaiArchive : ParsedHttpSource() {
|
|||
.add("Referer", "$baseUrl/")
|
||||
.build()
|
||||
|
||||
override val client = super.client.newBuilder()
|
||||
override val client = network.cloudflareClient.newBuilder()
|
||||
.addInterceptor { chain ->
|
||||
val request = chain.request()
|
||||
val url = request.url.toString()
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
ext {
|
||||
extName = 'Sen Manga'
|
||||
extClass = '.SenManga'
|
||||
extVersionCode = 6
|
||||
extVersionCode = 7
|
||||
}
|
||||
|
||||
apply from: "$rootDir/common.gradle"
|
||||
|
|
|
@ -24,7 +24,7 @@ class SenManga : ParsedHttpSource() {
|
|||
override val baseUrl = "https://raw.senmanga.com"
|
||||
|
||||
@SuppressLint("DefaultLocale")
|
||||
override val client = super.client.newBuilder().addInterceptor {
|
||||
override val client = network.cloudflareClient.newBuilder().addInterceptor {
|
||||
// Intercept any image requests and add a referer to them
|
||||
// Enables bandwidth stealing feature
|
||||
val request = if (it.request().url.pathSegments.firstOrNull()?.trim()?.lowercase() == "viewer") {
|
||||
|
|
Loading…
Reference in New Issue