diff --git a/SoraStream/src/main/kotlin/com/hexated/SoraExtractor.kt b/SoraStream/src/main/kotlin/com/hexated/SoraExtractor.kt index 615a6dd5..d8237b52 100644 --- a/SoraStream/src/main/kotlin/com/hexated/SoraExtractor.kt +++ b/SoraStream/src/main/kotlin/com/hexated/SoraExtractor.kt @@ -1,6 +1,5 @@ package com.hexated -import android.util.Log import com.fasterxml.jackson.annotation.JsonProperty import com.lagradost.cloudstream3.* import com.lagradost.cloudstream3.utils.* @@ -2446,7 +2445,7 @@ object SoraExtractor : SoraStream() { val res = app.get(fixUrl(iframe, gomoviesAPI), verify = false) val match = "var url = '(/user/servers/.*?\\?ep=.*?)';".toRegex().find(res.text) val serverUrl = match?.groupValues?.get(1) ?: return - val cookies = res.okhttpResponse.headers.getPutlockerCookies() + val cookies = res.okhttpResponse.headers.getGomoviesCookies() val url = res.document.select("meta[property=og:url]").attr("content") val headers = mapOf("X-Requested-With" to "XMLHttpRequest") val qualities = intArrayOf(2160, 1440, 1080, 720, 480, 360) @@ -2461,7 +2460,7 @@ object SoraExtractor : SoraStream() { referer = url, headers = headers ).text - val json = base64Decode(encryptedData).putlockerDecrypt() + val json = base64Decode(encryptedData).decryptGomoviesJson() val links = tryParseJson>(json) ?: return@amap links.forEach { video -> qualities.filter { it <= video.max.toInt() }.forEach { diff --git a/SoraStream/src/main/kotlin/com/hexated/SoraUtils.kt b/SoraStream/src/main/kotlin/com/hexated/SoraUtils.kt index 8a86cc93..685489b1 100644 --- a/SoraStream/src/main/kotlin/com/hexated/SoraUtils.kt +++ b/SoraStream/src/main/kotlin/com/hexated/SoraUtils.kt @@ -729,7 +729,7 @@ fun decodeIndexJson(json: String): String { /** taken from https://github.com/821938089/cloudstream-extensions/blob/23dae833a48fb329d4c67dd77ac1e8bb592ac5a9/Movie123Provider/src/main/kotlin/com/horis/cloudstreamplugins/Movie123Provider.kt#L138-L150 - Credits to Horis **/ -fun String.putlockerDecrypt(key: String = "123"): String { +fun String.decryptGomoviesJson(key: String = "123"): String { val sb = StringBuilder() var i = 0 while (i < this.length) { @@ -743,7 +743,7 @@ fun String.putlockerDecrypt(key: String = "123"): String { return sb.toString() } -fun Headers.getPutlockerCookies(cookieKey: String = "set-cookie"): Map { +fun Headers.getGomoviesCookies(cookieKey: String = "set-cookie"): Map { val cookieList = this.filter { it.first.equals(cookieKey, ignoreCase = true) }.mapNotNull { it.second.split(";").firstOrNull()