From 1240225d14a997b67f4d8aba8a601e5c7055f360 Mon Sep 17 00:00:00 2001 From: hexated Date: Tue, 20 Sep 2022 19:51:33 +0700 Subject: [PATCH] fixed Loklok search --- Loklok/build.gradle.kts | 2 +- Loklok/src/main/kotlin/com/hexated/Loklok.kt | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Loklok/build.gradle.kts b/Loklok/build.gradle.kts index f1b04b53..52e68584 100644 --- a/Loklok/build.gradle.kts +++ b/Loklok/build.gradle.kts @@ -1,5 +1,5 @@ // use an integer for version numbers -version = 4 +version = 5 cloudstream { diff --git a/Loklok/src/main/kotlin/com/hexated/Loklok.kt b/Loklok/src/main/kotlin/com/hexated/Loklok.kt index ba304f0a..30f9dc49 100644 --- a/Loklok/src/main/kotlin/com/hexated/Loklok.kt +++ b/Loklok/src/main/kotlin/com/hexated/Loklok.kt @@ -33,7 +33,6 @@ class Loklok : MainAPI() { 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" } @@ -79,6 +78,8 @@ class Loklok : MainAPI() { // "searchType" to "" // ), headers = headers // ) + val buildId = app.get("${base64Decode("aHR0cHM6Ly9maWxtaG90LmxpdmUvc2VhcmNo")}?q=$query").text.substringAfterLast("\"buildId\":\"").substringBefore("\",") + val searchApi = "${base64Decode("aHR0cHM6Ly9maWxtaG90LmxpdmUvX25leHQvZGF0YQ==")}/$buildId" val res = app.get( "$searchApi/search.json?q=$query", headers = mapOf("x-nextjs-data" to "1")