From 207f010eb106a463eb53e3c7dc789771d8d816b3 Mon Sep 17 00:00:00 2001 From: Mike <51273546+SnakeDoc83@users.noreply.github.com> Date: Mon, 26 Aug 2019 07:19:36 -0400 Subject: [PATCH] MangaRock chapter delay fix (#1427) MangaRock chapter delay fix --- src/en/mangarock/build.gradle | 2 +- .../tachiyomi/extension/en/mangarock/MangaRock.kt | 10 ++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/en/mangarock/build.gradle b/src/en/mangarock/build.gradle index 9c08853ac..9c8774ad6 100644 --- a/src/en/mangarock/build.gradle +++ b/src/en/mangarock/build.gradle @@ -5,7 +5,7 @@ ext { appName = 'Tachiyomi: Manga Rock' pkgNameSuffix = 'en.mangarock' extClass = '.MangaRock' - extVersionCode = 12 + extVersionCode = 13 libVersion = '1.2' } diff --git a/src/en/mangarock/src/eu/kanade/tachiyomi/extension/en/mangarock/MangaRock.kt b/src/en/mangarock/src/eu/kanade/tachiyomi/extension/en/mangarock/MangaRock.kt index 4765068e5..daf124841 100644 --- a/src/en/mangarock/src/eu/kanade/tachiyomi/extension/en/mangarock/MangaRock.kt +++ b/src/en/mangarock/src/eu/kanade/tachiyomi/extension/en/mangarock/MangaRock.kt @@ -12,12 +12,7 @@ import eu.kanade.tachiyomi.source.model.Page import eu.kanade.tachiyomi.source.model.SChapter import eu.kanade.tachiyomi.source.model.SManga import eu.kanade.tachiyomi.source.online.HttpSource -import okhttp3.MediaType -import okhttp3.OkHttpClient -import okhttp3.Request -import okhttp3.RequestBody -import okhttp3.Response -import okhttp3.ResponseBody +import okhttp3.* import org.json.JSONObject import rx.Observable import java.util.ArrayList @@ -40,6 +35,9 @@ class MangaRock : HttpSource() { override val supportsLatest = true + override fun headersBuilder(): Headers.Builder = Headers.Builder() + .add("Origin", "https://mangarock.com") + // Handles the page decoding override val client: OkHttpClient = super.client.newBuilder().addInterceptor(fun(chain): Response { val url = chain.request().url().toString()