From 343d719236ca8ddbea75a94c8b47eee4bb656258 Mon Sep 17 00:00:00 2001 From: "Cuong M. Tran" Date: Tue, 16 Jan 2024 00:06:34 +0700 Subject: [PATCH] Revert changes to ReaperScans caused by stupid Cat & Mouse game which causing loading page way slow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Revert "fix RS (#16798)”: This reverts commit 152fb4e30aecf0b360f55b851a406bf62b94df25. * Revert "very cool (#16811)”: This reverts commit 1ff32938977d22ccf44d39c4a357ad5387c4f358. * Revert "Fixed ReaperScans”: This reverts commit 5e66857b451a8253b36476247abf589aba507cc1. --- .../extension/en/reaperscans/ReaperScans.kt | 22 +++---------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/src/en/reaperscans/src/eu/kanade/tachiyomi/extension/en/reaperscans/ReaperScans.kt b/src/en/reaperscans/src/eu/kanade/tachiyomi/extension/en/reaperscans/ReaperScans.kt index d30f2911a7..cbf982d4ff 100644 --- a/src/en/reaperscans/src/eu/kanade/tachiyomi/extension/en/reaperscans/ReaperScans.kt +++ b/src/en/reaperscans/src/eu/kanade/tachiyomi/extension/en/reaperscans/ReaperScans.kt @@ -1,6 +1,5 @@ package eu.kanade.tachiyomi.extension.en.reaperscans -import android.util.Base64 import eu.kanade.tachiyomi.network.GET import eu.kanade.tachiyomi.network.POST import eu.kanade.tachiyomi.network.interceptor.rateLimit @@ -277,26 +276,12 @@ class ReaperScans : ParsedHttpSource() { // Page override fun pageListParse(document: Document): List { - val html = document.selectFirst("main")?.html() - - return Jsoup.parse(html, baseUrl).select("img").mapIndexed { idx, element -> - Page(idx, imageUrl = element.imgAttr()) + document.select("noscript").remove() + return document.select("img.max-w-full").mapIndexed { index, element -> + Page(index, imageUrl = element.imgAttr()) } } - private fun randomString(): String { - val bytes_288 = Random.nextBytes(ByteArray(288)) - val base64_288 = Base64.encodeToString(bytes_288, Base64.DEFAULT) - - val bytes_16 = Random.nextBytes(ByteArray(16)) - val base64_16 = Base64.encodeToString(bytes_16, Base64.DEFAULT) - - val bytes_32 = Random.nextBytes(ByteArray(32)) - val hex32 = bytes_32.joinToString("") { "%02x".format(it) } - - return "0.$base64_288.$base64_16.$hex32" - } - // Helpers private inline fun Response.parseJson(): T = use { it.body.string().parseJson() @@ -356,6 +341,5 @@ class ReaperScans : ParsedHttpSource() { companion object { private val JSON_MEDIA_TYPE = "application/json; charset=utf-8".toMediaType() const val PREFIX_ID_SEARCH = "id:" - private val tunstile by lazy { Regex("""set\s*\(\s*\"([^"]*)""") } } }