Skip to content

Commit

Permalink
Revert changes to ReaperScans caused by stupid Cat & Mouse game which…
Browse files Browse the repository at this point in the history
… causing loading page way slow

* Revert "fix RS (#16798)”: This reverts commit 152fb4e.
* Revert "very cool (#16811)”: This reverts commit 1ff3293.
* Revert "Fixed ReaperScans”: This reverts commit 5e66857.
  • Loading branch information
cuong-tran committed Jan 15, 2024
1 parent e879a60 commit 343d719
Showing 1 changed file with 3 additions and 19 deletions.
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -277,26 +276,12 @@ class ReaperScans : ParsedHttpSource() {

// Page
override fun pageListParse(document: Document): List<Page> {
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 <reified T> Response.parseJson(): T = use {
it.body.string().parseJson()
Expand Down Expand Up @@ -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*\"([^"]*)""") }
}
}

0 comments on commit 343d719

Please sign in to comment.