Fix MangaLivre Cloudflare error. (#1511)
Fix MangaLivre Cloudflare error
This commit is contained in:
parent
7203688476
commit
dd7c58db69
@ -5,7 +5,7 @@ ext {
|
|||||||
appName = 'Tachiyomi: mangásPROJECT'
|
appName = 'Tachiyomi: mangásPROJECT'
|
||||||
pkgNameSuffix = 'pt.mangasproject'
|
pkgNameSuffix = 'pt.mangasproject'
|
||||||
extClass = '.MangasProjectFactory'
|
extClass = '.MangasProjectFactory'
|
||||||
extVersionCode = 4
|
extVersionCode = 5
|
||||||
libVersion = '1.2'
|
libVersion = '1.2'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,12 +21,15 @@ import java.util.concurrent.TimeUnit
|
|||||||
|
|
||||||
abstract class MangasProject(override val name: String,
|
abstract class MangasProject(override val name: String,
|
||||||
override val baseUrl: String) : HttpSource() {
|
override val baseUrl: String) : HttpSource() {
|
||||||
|
|
||||||
override val lang = "pt"
|
override val lang = "pt"
|
||||||
|
|
||||||
override val supportsLatest = true
|
override val supportsLatest = true
|
||||||
|
|
||||||
|
private val correctClient = if (name == "MangaLivre") network.cloudflareClient else network.client
|
||||||
|
|
||||||
// Sometimes the site is slow.
|
// Sometimes the site is slow.
|
||||||
override val client = network.client.newBuilder()
|
override val client = correctClient.newBuilder()
|
||||||
.connectTimeout(1, TimeUnit.MINUTES)
|
.connectTimeout(1, TimeUnit.MINUTES)
|
||||||
.readTimeout(1, TimeUnit.MINUTES)
|
.readTimeout(1, TimeUnit.MINUTES)
|
||||||
.writeTimeout(1, TimeUnit.MINUTES)
|
.writeTimeout(1, TimeUnit.MINUTES)
|
||||||
@ -276,7 +279,7 @@ abstract class MangasProject(override val name: String,
|
|||||||
val token = TOKEN_REGEX.find(readerSrc)?.groupValues?.get(1) ?: ""
|
val token = TOKEN_REGEX.find(readerSrc)?.groupValues?.get(1) ?: ""
|
||||||
|
|
||||||
if (token.isEmpty())
|
if (token.isEmpty())
|
||||||
throw Exception("Mangá licenciado e removido pela editora.")
|
throw Exception("Não foi possível obter o token de leitura.")
|
||||||
|
|
||||||
return chain.proceed(pageListApiRequest(request.url().toString(), token))
|
return chain.proceed(pageListApiRequest(request.url().toString(), token))
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user