Fix MangaLivre Cloudflare error. (#1511)

Fix MangaLivre Cloudflare error
This commit is contained in:
Alessandro Jean 2019-09-16 12:12:17 -03:00 committed by arkon
parent 7203688476
commit dd7c58db69
2 changed files with 7 additions and 4 deletions

View File

@ -5,7 +5,7 @@ ext {
appName = 'Tachiyomi: mangásPROJECT'
pkgNameSuffix = 'pt.mangasproject'
extClass = '.MangasProjectFactory'
extVersionCode = 4
extVersionCode = 5
libVersion = '1.2'
}

View File

@ -21,12 +21,15 @@ import java.util.concurrent.TimeUnit
abstract class MangasProject(override val name: String,
override val baseUrl: String) : HttpSource() {
override val lang = "pt"
override val supportsLatest = true
private val correctClient = if (name == "MangaLivre") network.cloudflareClient else network.client
// Sometimes the site is slow.
override val client = network.client.newBuilder()
override val client = correctClient.newBuilder()
.connectTimeout(1, TimeUnit.MINUTES)
.readTimeout(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) ?: ""
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))
}