mirror of
https://github.com/recloudstream/cloudstream-extensions-multilingual.git
synced 2024-08-15 03:15:14 +00:00
Update StreamingcommunityProvider.kt
This commit is contained in:
parent
b368fcce02
commit
e76acb9ffb
1 changed files with 13 additions and 8 deletions
|
@ -2,10 +2,10 @@ package com.lagradost
|
||||||
|
|
||||||
import android.text.Html
|
import android.text.Html
|
||||||
import com.fasterxml.jackson.annotation.*
|
import com.fasterxml.jackson.annotation.*
|
||||||
import com.lagradost.cloudstream3.*
|
|
||||||
import com.lagradost.cloudstream3.utils.AppUtils.parseJson
|
import com.lagradost.cloudstream3.utils.AppUtils.parseJson
|
||||||
import com.lagradost.cloudstream3.LoadResponse.Companion.addTrailer
|
import com.lagradost.cloudstream3.LoadResponse.Companion.addTrailer
|
||||||
import com.lagradost.cloudstream3.utils.*
|
import com.lagradost.cloudstream3.utils.*
|
||||||
|
import com.lagradost.cloudstream3.*
|
||||||
import org.json.JSONObject
|
import org.json.JSONObject
|
||||||
import java.net.URI
|
import java.net.URI
|
||||||
import java.security.MessageDigest
|
import java.security.MessageDigest
|
||||||
|
@ -126,10 +126,10 @@ data class TrailerElement(
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
class StreamingcommunityProvider : MainAPI() {
|
class StreamingcommunityProvider: MainAPI() {
|
||||||
override var lang = "it"
|
override var lang = "it"
|
||||||
override var mainUrl = "https://streamingcommunity.tech"
|
override var mainUrl = "https://streamingcommunity.tech"
|
||||||
override var name = "Streamingcommunity"
|
override var name = "StreamingCommunity"
|
||||||
override val hasMainPage = true
|
override val hasMainPage = true
|
||||||
override val hasChromecastSupport = true
|
override val hasChromecastSupport = true
|
||||||
override val supportedTypes = setOf(
|
override val supportedTypes = setOf(
|
||||||
|
@ -425,13 +425,18 @@ class StreamingcommunityProvider : MainAPI() {
|
||||||
val scwsid = jsn.getString("scws_id")
|
val scwsid = jsn.getString("scws_id")
|
||||||
val expire = (System.currentTimeMillis() / 1000 + 172800).toString()
|
val expire = (System.currentTimeMillis() / 1000 + 172800).toString()
|
||||||
|
|
||||||
val uno = "$expire$ip Yc8U6r8KjAKAepEA".toByteArray()
|
val token0 = "$expire$ip Yc8U6r8KjAKAepEA".toByteArray()
|
||||||
val due = MessageDigest.getInstance("MD5").digest(uno)
|
val token1 = MessageDigest.getInstance("MD5").digest(token0)
|
||||||
val tre = base64Encode(due)
|
val token2 = base64Encode(token1)
|
||||||
val token = tre.replace("=", "").replace("+", "-").replace("/", "_")
|
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)
|
getM3u8Qualities(link, data, URI(link).host).forEach(callback)
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue