mirror of
https://github.com/hexated/cloudstream-extensions-hexated.git
synced 2024-08-15 00:03:22 +00:00
update
This commit is contained in:
parent
ec145049a1
commit
d94f79e9a7
2 changed files with 47 additions and 2 deletions
|
@ -2260,10 +2260,11 @@ object SoraExtractor : SoraStream() {
|
|||
}
|
||||
|
||||
val session = "PHPSESSID=ngr4cudjrimdnhkth30ssohs0n; _csrf=a6ffd7bb7654083fce6df528225a238d0e85aa1fb885dc7638c1259ec1ba0d5ca%3A2%3A%7Bi%3A0%3Bs%3A5%3A%22_csrf%22%3Bi%3A1%3Bs%3A32%3A%22mTTLiDLjxohs-CpKk0bjRH3HdYMB9uBV%22%3B%7D; _ga=GA1.1.1195498587.1701871187; _ga_VZD7HJ3WK6=GS1.1.$unixTime.4.0.1.$unixTime.0.0.0"
|
||||
cinemaCookiesChecker(session)
|
||||
|
||||
val headers = mapOf(
|
||||
"Cookie" to session,
|
||||
"Connection" to "keep-alive",
|
||||
"x-requested-with" to "XMLHttpRequest",
|
||||
"x-requested-with" to "com.wwcinematv",
|
||||
)
|
||||
|
||||
val doc = app.get(url, headers = headers).document
|
||||
|
|
|
@ -49,6 +49,7 @@ import kotlin.math.min
|
|||
var watchflxCookies: Map<String, String>? = null
|
||||
var filmxyCookies: Map<String, String>? = null
|
||||
var sfServer: String? = null
|
||||
var cinemaCookiesChecker: Boolean? = null
|
||||
|
||||
val encodedIndex = arrayOf(
|
||||
"GamMovies",
|
||||
|
@ -647,6 +648,49 @@ suspend fun getTvMoviesServer(url: String, season: Int?, episode: Int?): Pair<St
|
|||
}
|
||||
}
|
||||
|
||||
suspend fun cinemaCookiesChecker(session: String) = cinemaCookiesChecker ?: fetchCinemaCookiesChecker(session).also { cinemaCookiesChecker = it }
|
||||
|
||||
suspend fun fetchCinemaCookiesChecker(session: String): Boolean {
|
||||
val wiwiApi = base64Decode("aHR0cHM6Ly9jaW5lbWEud2l3aWNlbnRlci5jb20=")
|
||||
suspend fun createConfig(headers: Map<String, String>) {
|
||||
app.get(
|
||||
"$wiwiApi/api/v1/app-config",
|
||||
headers = headers
|
||||
).text
|
||||
}
|
||||
suspend fun checkCookies(session: String, headers: Map<String, String>) {
|
||||
app.post(
|
||||
"$wiwiApi/api/v1/cookie",
|
||||
data = mapOf("cookie" to session),
|
||||
headers = headers
|
||||
).text
|
||||
}
|
||||
val configHeaders = mapOf(
|
||||
"App-version" to "3.4",
|
||||
"Authorization" to "Basic d2l3aTpXaXdpQDIwMjA=",
|
||||
"Country" to "Indonesia",
|
||||
"Device-id" to getDeviceId(),
|
||||
"User-id" to "user-6694327",
|
||||
)
|
||||
listOf(1..2).apmap { createConfig(configHeaders) }
|
||||
val unityData = """
|
||||
{
|
||||
"platform": "android",
|
||||
"idfi": "d1ec7051-f58f-4ddb-9da8-8debb82cfbea",
|
||||
"sdkVersionName": "4.3.0",
|
||||
"gdpr.consent": true,
|
||||
"user.nonbehavioral": false,
|
||||
"unity.privacy.permissions.all": false,
|
||||
"unity.privacy.permissions.gameExp": false,
|
||||
"unity.privacy.permissions.ads": false,
|
||||
"unity.privacy.permissions.external": false
|
||||
}
|
||||
""".trimIndent().toJson().toRequestBody(RequestBodyTypes.JSON.toMediaTypeOrNull())
|
||||
app.post("https://configv2.unityads.unity3d.com/privacy/4519473/state", requestBody = unityData).text
|
||||
listOf(1..4).map {checkCookies(session, configHeaders)}
|
||||
return true
|
||||
}
|
||||
|
||||
suspend fun getSfServer() = sfServer ?: fetchSfServer().also { sfServer = it }
|
||||
|
||||
suspend fun fetchSfServer(): String {
|
||||
|
|
Loading…
Reference in a new issue