From e76acb9ffb83e1c4027fe7d10ce412fd1c6bf1b9 Mon Sep 17 00:00:00 2001 From: antonydp <38143733+antonydp@users.noreply.github.com> Date: Sat, 1 Oct 2022 02:02:05 +0200 Subject: [PATCH] Update StreamingcommunityProvider.kt --- .../lagradost/StreamingcommunityProvider.kt | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/StreamingcommunityProvider/src/main/kotlin/com/lagradost/StreamingcommunityProvider.kt b/StreamingcommunityProvider/src/main/kotlin/com/lagradost/StreamingcommunityProvider.kt index b3cc074..5564bfd 100644 --- a/StreamingcommunityProvider/src/main/kotlin/com/lagradost/StreamingcommunityProvider.kt +++ b/StreamingcommunityProvider/src/main/kotlin/com/lagradost/StreamingcommunityProvider.kt @@ -2,10 +2,10 @@ package com.lagradost import android.text.Html import com.fasterxml.jackson.annotation.* -import com.lagradost.cloudstream3.* import com.lagradost.cloudstream3.utils.AppUtils.parseJson import com.lagradost.cloudstream3.LoadResponse.Companion.addTrailer import com.lagradost.cloudstream3.utils.* +import com.lagradost.cloudstream3.* import org.json.JSONObject import java.net.URI import java.security.MessageDigest @@ -126,10 +126,10 @@ data class TrailerElement( ) -class StreamingcommunityProvider : MainAPI() { +class StreamingcommunityProvider: MainAPI() { override var lang = "it" override var mainUrl = "https://streamingcommunity.tech" - override var name = "Streamingcommunity" + override var name = "StreamingCommunity" override val hasMainPage = true override val hasChromecastSupport = true override val supportedTypes = setOf( @@ -425,13 +425,18 @@ class StreamingcommunityProvider : MainAPI() { val scwsid = jsn.getString("scws_id") val expire = (System.currentTimeMillis() / 1000 + 172800).toString() - val uno = "$expire$ip Yc8U6r8KjAKAepEA".toByteArray() - val due = MessageDigest.getInstance("MD5").digest(uno) - val tre = base64Encode(due) - val token = tre.replace("=", "").replace("+", "-").replace("/", "_") + val token0 = "$expire$ip Yc8U6r8KjAKAepEA".toByteArray() + val token1 = MessageDigest.getInstance("MD5").digest(token0) + val token2 = base64Encode(token1) + val token = token2.replace("=", "").replace("+", "-").replace("/", "_") + val link = "https://scws.work/master/$scwsid?token=$token&expires=$expire&n=1" + Regex("URI=\".*\"").findAll(app.get("https://scws.work/master/$scwsid?token=$token&expires=$expire&n=1").text).toList().filter{it.value.contains("auto-forced").not()}.map{ + val link = app.get(it.value.substringAfter("\"").dropLast(1)).text.lines().filter{it.contains("http")}[0] + val lang = it.value.substringAfter("rendition=").substringBefore("&") + SubtitleFile(lang, link) + }.forEach(subtitleCallback) - val link = "https://scws.xyz/master/$scwsid?token=$token&expires=$expire&n=1&n=1" getM3u8Qualities(link, data, URI(link).host).forEach(callback) return true }