From 5bec47b3b222ea79867da7eb3bcef414312b8477 Mon Sep 17 00:00:00 2001 From: hexated Date: Fri, 9 Dec 2022 21:08:31 +0700 Subject: [PATCH] fixed Loklok --- Loklok/build.gradle.kts | 2 +- Loklok/src/main/kotlin/com/hexated/Loklok.kt | 91 ++++++++++---------- 2 files changed, 48 insertions(+), 45 deletions(-) diff --git a/Loklok/build.gradle.kts b/Loklok/build.gradle.kts index 6cf3c0a9..65a46a3d 100644 --- a/Loklok/build.gradle.kts +++ b/Loklok/build.gradle.kts @@ -1,5 +1,5 @@ // use an integer for version numbers -version = 9 +version = 10 cloudstream { diff --git a/Loklok/src/main/kotlin/com/hexated/Loklok.kt b/Loklok/src/main/kotlin/com/hexated/Loklok.kt index 5c96bca5..acb37a24 100644 --- a/Loklok/src/main/kotlin/com/hexated/Loklok.kt +++ b/Loklok/src/main/kotlin/com/hexated/Loklok.kt @@ -2,13 +2,13 @@ package com.hexated import com.fasterxml.jackson.annotation.JsonProperty import com.lagradost.cloudstream3.* -import com.lagradost.cloudstream3.mvvm.safeApiCall +import com.lagradost.cloudstream3.utils.* import com.lagradost.cloudstream3.utils.AppUtils.parseJson import com.lagradost.cloudstream3.utils.AppUtils.toJson -import com.lagradost.cloudstream3.utils.ExtractorLink -import com.lagradost.cloudstream3.utils.SubtitleHelper -import com.lagradost.cloudstream3.utils.getQualityFromName -import kotlinx.coroutines.delay +import com.lagradost.cloudstream3.utils.AppUtils.tryParseJson +import com.lagradost.nicehttp.RequestBodyTypes +import okhttp3.MediaType.Companion.toMediaTypeOrNull +import okhttp3.RequestBody.Companion.toRequestBody class Loklok : MainAPI() { override var name = "Loklok" @@ -188,26 +188,26 @@ class Loklok : MainAPI() { val res = parseJson(data) - res.definitionList?.apmap { video -> - safeApiCall { - delay(500) - app.get( - "$apiUrl/media/previewInfo?category=${res.category}&contentId=${res.id}&episodeId=${res.epId}&definition=${video.code}", - headers = headers - ).parsedSafe