MangaSee, MangaLife: fix pages again, add rate limiting (#6135)
* MangaSee, MangaLife: fix pages again, add rate limiting * Add referer * More harsh rate limit * Fix again, rate limit even more
This commit is contained in:
parent
1d27e61f65
commit
c589750a11
|
@ -5,8 +5,12 @@ ext {
|
||||||
extName = 'MangaLife'
|
extName = 'MangaLife'
|
||||||
pkgNameSuffix = 'en.mangalife'
|
pkgNameSuffix = 'en.mangalife'
|
||||||
extClass = '.MangaLife'
|
extClass = '.MangaLife'
|
||||||
extVersionCode = 13
|
extVersionCode = 14
|
||||||
libVersion = '1.2'
|
libVersion = '1.2'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
implementation project(':lib-ratelimit')
|
||||||
|
}
|
||||||
|
|
||||||
apply from: "$rootDir/common.gradle"
|
apply from: "$rootDir/common.gradle"
|
||||||
|
|
|
@ -7,6 +7,7 @@ import com.github.salomonbrys.kotson.string
|
||||||
import com.google.gson.GsonBuilder
|
import com.google.gson.GsonBuilder
|
||||||
import com.google.gson.JsonArray
|
import com.google.gson.JsonArray
|
||||||
import com.google.gson.JsonElement
|
import com.google.gson.JsonElement
|
||||||
|
import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor
|
||||||
import eu.kanade.tachiyomi.network.GET
|
import eu.kanade.tachiyomi.network.GET
|
||||||
import eu.kanade.tachiyomi.network.asObservableSuccess
|
import eu.kanade.tachiyomi.network.asObservableSuccess
|
||||||
import eu.kanade.tachiyomi.source.model.Filter
|
import eu.kanade.tachiyomi.source.model.Filter
|
||||||
|
@ -40,13 +41,17 @@ class MangaLife : HttpSource() {
|
||||||
|
|
||||||
override val supportsLatest = true
|
override val supportsLatest = true
|
||||||
|
|
||||||
|
private val rateLimitInterceptor = RateLimitInterceptor(1, 2)
|
||||||
|
|
||||||
override val client: OkHttpClient = network.cloudflareClient.newBuilder()
|
override val client: OkHttpClient = network.cloudflareClient.newBuilder()
|
||||||
|
.addNetworkInterceptor(rateLimitInterceptor)
|
||||||
.connectTimeout(1, TimeUnit.MINUTES)
|
.connectTimeout(1, TimeUnit.MINUTES)
|
||||||
.readTimeout(1, TimeUnit.MINUTES)
|
.readTimeout(1, TimeUnit.MINUTES)
|
||||||
.writeTimeout(1, TimeUnit.MINUTES)
|
.writeTimeout(1, TimeUnit.MINUTES)
|
||||||
.build()
|
.build()
|
||||||
|
|
||||||
override fun headersBuilder(): Headers.Builder = Headers.Builder()
|
override fun headersBuilder(): Headers.Builder = Headers.Builder()
|
||||||
|
.add("Referer", baseUrl)
|
||||||
.add("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:71.0) Gecko/20100101 Firefox/77.0")
|
.add("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:71.0) Gecko/20100101 Firefox/77.0")
|
||||||
|
|
||||||
private val gson = GsonBuilder().setLenient().create()
|
private val gson = GsonBuilder().setLenient().create()
|
||||||
|
@ -259,7 +264,7 @@ class MangaLife : HttpSource() {
|
||||||
|
|
||||||
val pageTotal = curChapter["Page"].string.toInt()
|
val pageTotal = curChapter["Page"].string.toInt()
|
||||||
|
|
||||||
val host = "https://" + script.substringAfter("vm.CurrPathName = \"").substringBefore("\"")
|
val host = "https://" + script.substringAfter("vm.justgiveupalready = \"").substringBefore("\"")
|
||||||
val titleURI = script.substringAfter("vm.IndexName = \"").substringBefore("\"")
|
val titleURI = script.substringAfter("vm.IndexName = \"").substringBefore("\"")
|
||||||
val seasonURI = curChapter["Directory"].string
|
val seasonURI = curChapter["Directory"].string
|
||||||
.let { if (it.isEmpty()) "" else "$it/" }
|
.let { if (it.isEmpty()) "" else "$it/" }
|
||||||
|
|
|
@ -5,8 +5,12 @@ ext {
|
||||||
extName = 'Mangasee'
|
extName = 'Mangasee'
|
||||||
pkgNameSuffix = 'en.mangasee'
|
pkgNameSuffix = 'en.mangasee'
|
||||||
extClass = '.Mangasee'
|
extClass = '.Mangasee'
|
||||||
extVersionCode = 17
|
extVersionCode = 18
|
||||||
libVersion = '1.2'
|
libVersion = '1.2'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
implementation project(':lib-ratelimit')
|
||||||
|
}
|
||||||
|
|
||||||
apply from: "$rootDir/common.gradle"
|
apply from: "$rootDir/common.gradle"
|
||||||
|
|
|
@ -7,6 +7,7 @@ import com.github.salomonbrys.kotson.string
|
||||||
import com.google.gson.GsonBuilder
|
import com.google.gson.GsonBuilder
|
||||||
import com.google.gson.JsonArray
|
import com.google.gson.JsonArray
|
||||||
import com.google.gson.JsonElement
|
import com.google.gson.JsonElement
|
||||||
|
import eu.kanade.tachiyomi.lib.ratelimit.RateLimitInterceptor
|
||||||
import eu.kanade.tachiyomi.network.GET
|
import eu.kanade.tachiyomi.network.GET
|
||||||
import eu.kanade.tachiyomi.network.asObservableSuccess
|
import eu.kanade.tachiyomi.network.asObservableSuccess
|
||||||
import eu.kanade.tachiyomi.source.model.Filter
|
import eu.kanade.tachiyomi.source.model.Filter
|
||||||
|
@ -43,13 +44,17 @@ class Mangasee : HttpSource() {
|
||||||
|
|
||||||
override val supportsLatest = true
|
override val supportsLatest = true
|
||||||
|
|
||||||
|
private val rateLimitInterceptor = RateLimitInterceptor(1, 2)
|
||||||
|
|
||||||
override val client: OkHttpClient = network.cloudflareClient.newBuilder()
|
override val client: OkHttpClient = network.cloudflareClient.newBuilder()
|
||||||
|
.addNetworkInterceptor(rateLimitInterceptor)
|
||||||
.connectTimeout(1, TimeUnit.MINUTES)
|
.connectTimeout(1, TimeUnit.MINUTES)
|
||||||
.readTimeout(1, TimeUnit.MINUTES)
|
.readTimeout(1, TimeUnit.MINUTES)
|
||||||
.writeTimeout(1, TimeUnit.MINUTES)
|
.writeTimeout(1, TimeUnit.MINUTES)
|
||||||
.build()
|
.build()
|
||||||
|
|
||||||
override fun headersBuilder(): Headers.Builder = Headers.Builder()
|
override fun headersBuilder(): Headers.Builder = Headers.Builder()
|
||||||
|
.add("Referer", baseUrl)
|
||||||
.add("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:71.0) Gecko/20100101 Firefox/77.0")
|
.add("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:71.0) Gecko/20100101 Firefox/77.0")
|
||||||
|
|
||||||
private val gson = GsonBuilder().setLenient().create()
|
private val gson = GsonBuilder().setLenient().create()
|
||||||
|
@ -263,7 +268,7 @@ class Mangasee : HttpSource() {
|
||||||
|
|
||||||
val pageTotal = curChapter["Page"].string.toInt()
|
val pageTotal = curChapter["Page"].string.toInt()
|
||||||
|
|
||||||
val host = "https://" + script.substringAfter("vm.CurrPathName = \"").substringBefore("\"")
|
val host = "https://" + script.substringAfter("vm.justgiveupalready = \"").substringBefore("\"")
|
||||||
val titleURI = script.substringAfter("vm.IndexName = \"").substringBefore("\"")
|
val titleURI = script.substringAfter("vm.IndexName = \"").substringBefore("\"")
|
||||||
val seasonURI = curChapter["Directory"].string
|
val seasonURI = curChapter["Directory"].string
|
||||||
.let { if (it.isEmpty()) "" else "$it/" }
|
.let { if (it.isEmpty()) "" else "$it/" }
|
||||||
|
|
Loading…
Reference in New Issue