From 454c93fd88f99415181004244a8295df2c2b43e4 Mon Sep 17 00:00:00 2001 From: hexated Date: Thu, 15 Sep 2022 09:40:50 +0700 Subject: [PATCH] fixed --- Loklok/src/main/kotlin/com/hexated/Loklok.kt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Loklok/src/main/kotlin/com/hexated/Loklok.kt b/Loklok/src/main/kotlin/com/hexated/Loklok.kt index 2f5099ed..8d1f1c2b 100644 --- a/Loklok/src/main/kotlin/com/hexated/Loklok.kt +++ b/Loklok/src/main/kotlin/com/hexated/Loklok.kt @@ -29,10 +29,12 @@ class Loklok : MainAPI() { // no license found // thanks to https://github.com/napthedev/filmhot for providing API - private val api = base64Decode("aHR0cHM6Ly9nYS1tb2JpbGUtYXBpLmxva2xvay50dg==") - private val apiUrl = "$api/${base64Decode("Y21zL2FwcA==")}" - - private val mainImageUrl = "https://images.weserv.nl" + companion object { + private val api = base64Decode("aHR0cHM6Ly9nYS1tb2JpbGUtYXBpLmxva2xvay50dg==") + private val apiUrl = "$api/${base64Decode("Y21zL2FwcA==")}" + private val searchApi = base64Decode("aHR0cHM6Ly9maWxtaG90LmxpdmUvX25leHQvZGF0YS9NeXQzRm4tVHRXaHJ2a1RBaG45SGw=") + private const val mainImageUrl = "https://images.weserv.nl" + } private fun encode(input: String): String? = java.net.URLEncoder.encode(input, "utf-8") @@ -75,8 +77,6 @@ class Loklok : MainAPI() { // "searchType" to "" // ), headers = headers // ) - val searchApi = - base64Decode("aHR0cHM6Ly9maWxtaG90LmxpdmUvX25leHQvZGF0YS9NeXQzRm4tVHRXaHJ2a1RBaG45SGw=") val res = app.get( "$searchApi/search.json?q=$query", headers = mapOf("x-nextjs-data" to "1")