From 14ae8cb74eb84777e0beaa2ab4d11799ff705ec2 Mon Sep 17 00:00:00 2001 From: Stormunblessed <86633626+Stormunblessed@users.noreply.github.com> Date: Sat, 28 May 2022 14:56:07 +0000 Subject: [PATCH] Key fixes (#1097) * Key fix @Modder4869 * link change --- .github/workflows/prerelease.yml | 1 + .../com/lagradost/cloudstream3/extractors/Mcloud.kt | 3 +++ .../lagradost/cloudstream3/extractors/WcoStream.kt | 5 +++-- .../cloudstream3/extractors/helper/WcoHelper.kt | 12 ++++++++++++ docs/wcokey.txt | 1 + 5 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 app/src/main/java/com/lagradost/cloudstream3/extractors/helper/WcoHelper.kt create mode 100644 docs/wcokey.txt diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml index 4859511a..ee17ed43 100644 --- a/.github/workflows/prerelease.yml +++ b/.github/workflows/prerelease.yml @@ -6,6 +6,7 @@ on: paths-ignore: - '*.md' - '*.json' + - '**/wcokey.txt' concurrency: group: "pre-release" diff --git a/app/src/main/java/com/lagradost/cloudstream3/extractors/Mcloud.kt b/app/src/main/java/com/lagradost/cloudstream3/extractors/Mcloud.kt index b11ae2cc..b3c4b75b 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/extractors/Mcloud.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/extractors/Mcloud.kt @@ -6,6 +6,8 @@ import com.lagradost.cloudstream3.apmap import com.lagradost.cloudstream3.app import com.lagradost.cloudstream3.extractors.WcoStream.Companion.cipher import com.lagradost.cloudstream3.extractors.WcoStream.Companion.encrypt +import com.lagradost.cloudstream3.extractors.WcoStream.Companion.keytwo +import com.lagradost.cloudstream3.extractors.helper.WcoHelper.Companion.getWcoKey import com.lagradost.cloudstream3.utils.AppUtils.parseJson import com.lagradost.cloudstream3.utils.ExtractorApi import com.lagradost.cloudstream3.utils.ExtractorLink @@ -32,6 +34,7 @@ open class Mcloud : ExtractorApi() { private val key = "LCbu3iYC7ln24K7P" // key credits @Modder4869 override suspend fun getUrl(url: String, referer: String?): List? { val id = url.substringAfter("e/").substringAfter("embed/").substringBefore("?") + keytwo = getWcoKey() val encryptedid = encrypt(cipher(key, encrypt(id))).replace("/", "_").replace("=","") val link = "$mainUrl/info/$encryptedid" val response = app.get(link, headers = headers).text diff --git a/app/src/main/java/com/lagradost/cloudstream3/extractors/WcoStream.kt b/app/src/main/java/com/lagradost/cloudstream3/extractors/WcoStream.kt index d249a1a0..abd559d4 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/extractors/WcoStream.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/extractors/WcoStream.kt @@ -3,6 +3,7 @@ package com.lagradost.cloudstream3.extractors import com.fasterxml.jackson.annotation.JsonProperty import com.lagradost.cloudstream3.apmap import com.lagradost.cloudstream3.app +import com.lagradost.cloudstream3.extractors.helper.WcoHelper.Companion.getWcoKey import com.lagradost.cloudstream3.utils.ExtractorApi import com.lagradost.cloudstream3.utils.ExtractorLink import com.lagradost.cloudstream3.utils.M3u8Helper.Companion.generateM3u8 @@ -55,7 +56,7 @@ open class WcoStream : ExtractorApi() { override val requiresReferer = false companion object { - private val keytwo = "0wMrYU+ixjJ4QdzgfN2HlyIVAt3sBOZnCT9Lm7uFDovkb/EaKpRWhqXS5168ePcG" + var keytwo = "" fun encrypt(input: String): String { if (input.any { it.code >= 256 }) throw Exception("illegal characters!") var output = "" @@ -114,7 +115,7 @@ open class WcoStream : ExtractorApi() { )?.destructured) ?: return emptyList() // val (skey) = Regex("""skey\s=\s['"](.*?)['"];""").find(html)?.destructured // ?: return emptyList() - + keytwo = getWcoKey() val encryptedID = encrypt(cipher(key, encrypt(Id))).replace("/", "_").replace("=","") val apiLink = "$baseUrl/info/$encryptedID" val referrer = "$baseUrl/e/$Id?domain=wcostream.cc" diff --git a/app/src/main/java/com/lagradost/cloudstream3/extractors/helper/WcoHelper.kt b/app/src/main/java/com/lagradost/cloudstream3/extractors/helper/WcoHelper.kt new file mode 100644 index 00000000..5fb2524b --- /dev/null +++ b/app/src/main/java/com/lagradost/cloudstream3/extractors/helper/WcoHelper.kt @@ -0,0 +1,12 @@ +package com.lagradost.cloudstream3.extractors.helper + +import com.lagradost.cloudstream3.app + +class WcoHelper { + companion object { + suspend fun getWcoKey(): String { + val i = app.get("https://raw.githubusercontent.com/LagradOst/CloudStream-3/master/docs/wcokey.txt").text + return i + } + } +} \ No newline at end of file diff --git a/docs/wcokey.txt b/docs/wcokey.txt new file mode 100644 index 00000000..a3f3ecf6 --- /dev/null +++ b/docs/wcokey.txt @@ -0,0 +1 @@ +51wJ0FDq/UVCefLopEcmK3ni4WIQztMjZdSYOsbHr9R2h7PvxBGAuglaN8+kXT6y \ No newline at end of file