Explicit cloudflareClient if Cloudflare hosted (#6676)
This commit is contained in:
parent
be9c14bcae
commit
7ec1dfaf48
|
@ -2,4 +2,4 @@ plugins {
|
|||
id("lib-multisrc")
|
||||
}
|
||||
|
||||
baseVersionCode = 1
|
||||
baseVersionCode = 2
|
||||
|
|
|
@ -22,6 +22,8 @@ abstract class MangaReader : HttpSource(), ConfigurableSource {
|
|||
|
||||
override val supportsLatest = true
|
||||
|
||||
override val client = network.cloudflareClient
|
||||
|
||||
final override fun latestUpdatesParse(response: Response) = searchMangaParse(response)
|
||||
|
||||
final override fun popularMangaParse(response: Response) = searchMangaParse(response)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
ext {
|
||||
extName = 'Comick'
|
||||
extClass = '.ComickFactory'
|
||||
extVersionCode = 50
|
||||
extVersionCode = 51
|
||||
isNsfw = true
|
||||
}
|
||||
|
||||
|
|
|
@ -177,7 +177,7 @@ abstract class Comick(
|
|||
add("User-Agent", "Tachiyomi ${System.getProperty("http.agent")}")
|
||||
}
|
||||
|
||||
override val client = network.client.newBuilder()
|
||||
override val client = network.cloudflareClient.newBuilder()
|
||||
.addNetworkInterceptor(::errorInterceptor)
|
||||
.rateLimit(3, 1, TimeUnit.SECONDS)
|
||||
.build()
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
ext {
|
||||
extName = 'E-Hentai'
|
||||
extClass = '.EHFactory'
|
||||
extVersionCode = 22
|
||||
extVersionCode = 23
|
||||
isNsfw = true
|
||||
}
|
||||
|
||||
|
|
|
@ -398,7 +398,7 @@ abstract class EHentai(
|
|||
.appendQueryParameter(param, value)
|
||||
.toString()
|
||||
|
||||
override val client = network.client.newBuilder()
|
||||
override val client = network.cloudflareClient.newBuilder()
|
||||
.cookieJar(CookieJar.NO_COOKIES)
|
||||
.addInterceptor { chain ->
|
||||
val newReq = chain
|
||||
|
|
|
@ -33,7 +33,7 @@ open class MangaFire(
|
|||
|
||||
private val json: Json by injectLazy()
|
||||
|
||||
override val client = network.cloudflareClient.newBuilder()
|
||||
override val client = super.client.newBuilder()
|
||||
.addInterceptor(ImageInterceptor)
|
||||
.build()
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ open class MangaReader(
|
|||
|
||||
override val baseUrl = "https://mangareader.to"
|
||||
|
||||
override val client = network.client.newBuilder()
|
||||
override val client = super.client.newBuilder()
|
||||
.addInterceptor(ImageInterceptor)
|
||||
.build()
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
ext {
|
||||
extName = 'NineManga'
|
||||
extClass = '.NineMangaFactory'
|
||||
extVersionCode = 20
|
||||
extVersionCode = 21
|
||||
}
|
||||
|
||||
apply from: "$rootDir/common.gradle"
|
||||
|
|
|
@ -29,7 +29,7 @@ open class NineManga(
|
|||
|
||||
private val cookieInterceptor = CookieInterceptor(baseUrl.substringAfter("://"), "ninemanga_list_num" to "1")
|
||||
|
||||
override val client: OkHttpClient = network.client.newBuilder()
|
||||
override val client: OkHttpClient = network.cloudflareClient.newBuilder()
|
||||
.addInterceptor { chain ->
|
||||
val request = chain.request()
|
||||
val url = request.url.toString()
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
ext {
|
||||
extName = 'Photos18'
|
||||
extClass = '.Photos18'
|
||||
extVersionCode = 4
|
||||
extVersionCode = 5
|
||||
isNsfw = true
|
||||
}
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ class Photos18 : HttpSource(), ConfigurableSource {
|
|||
private val baseUrlWithLang get() = if (useTrad) baseUrl else "$baseUrl/zh-hans"
|
||||
private fun String.stripLang() = removePrefix("/zh-hans")
|
||||
|
||||
override val client = network.client.newBuilder().followRedirects(false).build()
|
||||
override val client = network.cloudflareClient.newBuilder().followRedirects(false).build()
|
||||
|
||||
override fun headersBuilder() = Headers.Builder().apply {
|
||||
add("Referer", baseUrl)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
ext {
|
||||
extName = 'Project Suki'
|
||||
extClass = '.ProjectSuki'
|
||||
extVersionCode = 3
|
||||
extVersionCode = 4
|
||||
}
|
||||
|
||||
apply from: "$rootDir/common.gradle"
|
||||
|
|
|
@ -208,7 +208,7 @@ class ProjectSuki : HttpSource(), ConfigurableSource {
|
|||
* (this is a permalink, check for updated version),
|
||||
* most client options are already set as they should be, including the [Cache][okhttp3.Cache].
|
||||
*/
|
||||
override val client: OkHttpClient = network.client.newBuilder()
|
||||
override val client: OkHttpClient = network.cloudflareClient.newBuilder()
|
||||
.setRandomUserAgent(
|
||||
userAgentType = preferences.shared.getPrefUAType(),
|
||||
customUA = preferences.shared.getPrefCustomUA(),
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
ext {
|
||||
extName = 'Xinmeitulu'
|
||||
extClass = '.Xinmeitulu'
|
||||
extVersionCode = 4
|
||||
extVersionCode = 5
|
||||
isNsfw = true
|
||||
}
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ class Xinmeitulu : ParsedHttpSource() {
|
|||
override val name = "Xinmeitulu"
|
||||
override val supportsLatest = false
|
||||
|
||||
override val client = network.client.newBuilder().addInterceptor(::contentTypeIntercept).build()
|
||||
override val client = network.cloudflareClient.newBuilder().addInterceptor(::contentTypeIntercept).build()
|
||||
|
||||
// Latest
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
ext {
|
||||
extName = 'Cutie Comics'
|
||||
extClass = '.CutieComics'
|
||||
extVersionCode = 1
|
||||
extVersionCode = 2
|
||||
isNsfw = true
|
||||
}
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ class CutieComics : ParsedHttpSource() {
|
|||
|
||||
override val supportsLatest = false
|
||||
|
||||
override val client = network.client.newBuilder()
|
||||
override val client = network.cloudflareClient.newBuilder()
|
||||
.rateLimitHost(baseUrl.toHttpUrl(), 2)
|
||||
.build()
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
ext {
|
||||
extName = 'HentaiMode'
|
||||
extClass = '.HentaiMode'
|
||||
extVersionCode = 2
|
||||
extVersionCode = 3
|
||||
isNsfw = true
|
||||
}
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ class HentaiMode : ParsedHttpSource() {
|
|||
|
||||
override val supportsLatest = false
|
||||
|
||||
override val client = network.client.newBuilder()
|
||||
override val client = network.cloudflareClient.newBuilder()
|
||||
.rateLimitHost(baseUrl.toHttpUrl(), 2)
|
||||
.build()
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ ext {
|
|||
extClass = '.Nartag'
|
||||
themePkg = 'madara'
|
||||
baseUrl = 'https://traduccionesamistosas.eyudud.net'
|
||||
overrideVersionCode = 0
|
||||
overrideVersionCode = 1
|
||||
isNsfw = true
|
||||
}
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ class Nartag : Madara(
|
|||
) {
|
||||
override val versionId = 2
|
||||
|
||||
override val client: OkHttpClient = network.client.newBuilder()
|
||||
override val client: OkHttpClient = super.client.newBuilder()
|
||||
.rateLimitHost(baseUrl.toHttpUrl(), 2)
|
||||
.build()
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
ext {
|
||||
extName = 'Scan-Manga'
|
||||
extClass = '.ScanManga'
|
||||
extVersionCode = 7
|
||||
extVersionCode = 8
|
||||
isNsfw = true
|
||||
}
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ class ScanManga : ParsedHttpSource() {
|
|||
|
||||
override val supportsLatest = true
|
||||
|
||||
override val client: OkHttpClient = network.client.newBuilder()
|
||||
override val client: OkHttpClient = network.cloudflareClient.newBuilder()
|
||||
.addNetworkInterceptor { chain ->
|
||||
val originalCookies = chain.request().header("Cookie") ?: ""
|
||||
val newReq = chain
|
||||
|
|
|
@ -32,7 +32,7 @@ class RawOtaku : MangaReader() {
|
|||
|
||||
override val baseUrl = "https://rawotaku.com"
|
||||
|
||||
override val client = network.cloudflareClient.newBuilder()
|
||||
override val client = super.client.newBuilder()
|
||||
.rateLimit(2)
|
||||
.build()
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
ext {
|
||||
extName = 'Taiyō'
|
||||
extClass = '.Taiyo'
|
||||
extVersionCode = 3
|
||||
extVersionCode = 4
|
||||
isNsfw = true
|
||||
}
|
||||
|
||||
|
|
|
@ -60,7 +60,7 @@ class Taiyo : ParsedHttpSource() {
|
|||
|
||||
private var bearerToken: String = preferences.getString(BEARER_TOKEN_PREF, "").toString()
|
||||
|
||||
override val client = network.client.newBuilder()
|
||||
override val client = network.cloudflareClient.newBuilder()
|
||||
.rateLimitHost(baseUrl.toHttpUrl(), 2)
|
||||
.rateLimitHost(IMG_CDN.toHttpUrl(), 2)
|
||||
.addInterceptor(::authorizationInterceptor)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
ext {
|
||||
extName = 'Tao Sect'
|
||||
extClass = '.TaoSect'
|
||||
extVersionCode = 19
|
||||
extVersionCode = 20
|
||||
isNsfw = true
|
||||
}
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ class TaoSect : HttpSource() {
|
|||
|
||||
override val supportsLatest = true
|
||||
|
||||
override val client: OkHttpClient = network.client.newBuilder()
|
||||
override val client: OkHttpClient = network.cloudflareClient.newBuilder()
|
||||
.rateLimit(1, 2, TimeUnit.SECONDS)
|
||||
.build()
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ ext {
|
|||
extClass = '.MangaKings'
|
||||
themePkg = 'mangathemesia'
|
||||
baseUrl = 'https://mangakings.com.tr'
|
||||
overrideVersionCode = 0
|
||||
overrideVersionCode = 1
|
||||
}
|
||||
|
||||
apply from: "$rootDir/common.gradle"
|
||||
|
|
|
@ -14,7 +14,7 @@ class MangaKings : MangaThemesia(
|
|||
dateFormat = SimpleDateFormat("MMMM dd, yyyy", Locale("tr")),
|
||||
|
||||
) {
|
||||
override val client = network.client.newBuilder()
|
||||
override val client = super.client.newBuilder()
|
||||
.rateLimitHost(baseUrl.toHttpUrl(), 2)
|
||||
.build()
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
ext {
|
||||
extName = 'ManhuaDB'
|
||||
extClass = '.ManhuaDB'
|
||||
extVersionCode = 6
|
||||
extVersionCode = 7
|
||||
}
|
||||
|
||||
apply from: "$rootDir/common.gradle"
|
||||
|
|
|
@ -24,7 +24,7 @@ abstract class MDB(
|
|||
override val lang: String = "zh",
|
||||
) : ParsedHttpSource() {
|
||||
|
||||
override val client = network.client.newBuilder().rateLimit(2).build()
|
||||
override val client = network.cloudflareClient.newBuilder().rateLimit(2).build()
|
||||
|
||||
override fun headersBuilder() = super.headersBuilder().add("Referer", baseUrl)
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
ext {
|
||||
extName = 'Roumanwu'
|
||||
extClass = '.Roumanwu'
|
||||
extVersionCode = 12
|
||||
extVersionCode = 13
|
||||
isNsfw = true
|
||||
}
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ class Roumanwu : ParsedHttpSource(), ConfigurableSource {
|
|||
max(MIRRORS.size - 1, preferences.getString(MIRROR_PREF, MIRROR_DEFAULT)!!.toInt()),
|
||||
]
|
||||
|
||||
override val client = network.client.newBuilder().addInterceptor(ScrambledImageInterceptor).build()
|
||||
override val client = network.cloudflareClient.newBuilder().addInterceptor(ScrambledImageInterceptor).build()
|
||||
|
||||
private val imageUrlRegex = """\\"imageUrl\\":\\"(?<imageUrl>[^\\]+)""".toRegex()
|
||||
|
||||
|
|
Loading…
Reference in New Issue