From c1b987fa6e181a539555ef91031bef31718c45f3 Mon Sep 17 00:00:00 2001 From: Logan B Date: Wed, 13 Feb 2019 03:18:04 +1300 Subject: [PATCH] [myreadingmanga] Add Cloudflare code (#819) [myreadingmanga] Add Cloudflare code --- src/all/myreadingmanga/build.gradle | 2 +- .../extension/all/myreadingmanga/MyReadingManga.kt | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/all/myreadingmanga/build.gradle b/src/all/myreadingmanga/build.gradle index a440b9c7b..3e36245a9 100644 --- a/src/all/myreadingmanga/build.gradle +++ b/src/all/myreadingmanga/build.gradle @@ -5,7 +5,7 @@ ext { appName = 'Tachiyomi: MyReadingManga' pkgNameSuffix = 'all.myreadingmanga' extClass = '.MyReadingMangaFactory' - extVersionCode = 18 + extVersionCode = 19 libVersion = '1.2' } diff --git a/src/all/myreadingmanga/src/eu/kanade/tachiyomi/extension/all/myreadingmanga/MyReadingManga.kt b/src/all/myreadingmanga/src/eu/kanade/tachiyomi/extension/all/myreadingmanga/MyReadingManga.kt index 5df5a203e..edcf8c6f2 100644 --- a/src/all/myreadingmanga/src/eu/kanade/tachiyomi/extension/all/myreadingmanga/MyReadingManga.kt +++ b/src/all/myreadingmanga/src/eu/kanade/tachiyomi/extension/all/myreadingmanga/MyReadingManga.kt @@ -5,11 +5,11 @@ import eu.kanade.tachiyomi.network.GET import eu.kanade.tachiyomi.source.model.* import eu.kanade.tachiyomi.source.online.ParsedHttpSource import eu.kanade.tachiyomi.util.asJsoup -import okhttp3.Request -import okhttp3.Response +import okhttp3.* import org.jsoup.nodes.Document import org.jsoup.nodes.Element import java.text.SimpleDateFormat +import java.util.concurrent.TimeUnit open class MyReadingManga(override val lang: String) : ParsedHttpSource() { @@ -17,6 +17,13 @@ open class MyReadingManga(override val lang: String) : ParsedHttpSource() { override val baseUrl = "https://myreadingmanga.info" + override val client: OkHttpClient = network.cloudflareClient.newBuilder() + .connectTimeout(1, TimeUnit.MINUTES) + .readTimeout(1, TimeUnit.MINUTES) + .retryOnConnectionFailure(true) + .followRedirects(true) + .build()!! + override val supportsLatest = false override fun popularMangaSelector() = "article"