parent
86e45b2678
commit
934ca4a97f
|
@ -1,7 +1,7 @@
|
||||||
ext {
|
ext {
|
||||||
extName = 'Reaper Scans'
|
extName = 'Reaper Scans'
|
||||||
extClass = '.ReaperScans'
|
extClass = '.ReaperScans'
|
||||||
extVersionCode = 48
|
extVersionCode = 49
|
||||||
}
|
}
|
||||||
|
|
||||||
apply from: "$rootDir/common.gradle"
|
apply from: "$rootDir/common.gradle"
|
||||||
|
|
|
@ -53,8 +53,18 @@ class ReaperScans : ParsedHttpSource() {
|
||||||
|
|
||||||
override val client: OkHttpClient = network.cloudflareClient.newBuilder()
|
override val client: OkHttpClient = network.cloudflareClient.newBuilder()
|
||||||
.rateLimit(1, 2, TimeUnit.SECONDS)
|
.rateLimit(1, 2, TimeUnit.SECONDS)
|
||||||
|
.addInterceptor { chain ->
|
||||||
|
val request = chain.request()
|
||||||
|
val headers = request.headers.newBuilder()
|
||||||
|
.removeAll("X-Requested-With")
|
||||||
|
.build()
|
||||||
|
chain.proceed(request.newBuilder().headers(headers).build())
|
||||||
|
}
|
||||||
.build()
|
.build()
|
||||||
|
|
||||||
|
override fun headersBuilder(): Headers.Builder = super.headersBuilder()
|
||||||
|
.set("X-Requested-With", randomString((1..20).random())) // For WebView, removed in interceptor
|
||||||
|
|
||||||
// Popular
|
// Popular
|
||||||
override fun popularMangaRequest(page: Int) = GET("$baseUrl/comics?page=$page", headers)
|
override fun popularMangaRequest(page: Int) = GET("$baseUrl/comics?page=$page", headers)
|
||||||
|
|
||||||
|
@ -336,6 +346,11 @@ class ReaperScans : ParsedHttpSource() {
|
||||||
|
|
||||||
private fun Elements.imgAttr(): String = this.first()!!.imgAttr()
|
private fun Elements.imgAttr(): String = this.first()!!.imgAttr()
|
||||||
|
|
||||||
|
private fun randomString(length: Int): String {
|
||||||
|
val charPool = ('a'..'z') + ('A'..'Z')
|
||||||
|
return List(length) { charPool.random() }.joinToString("")
|
||||||
|
}
|
||||||
|
|
||||||
// Unused
|
// Unused
|
||||||
override fun searchMangaNextPageSelector() = throw UnsupportedOperationException()
|
override fun searchMangaNextPageSelector() = throw UnsupportedOperationException()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue