diff --git a/SoraStream/src/main/kotlin/com/hexated/SoraExtractor.kt b/SoraStream/src/main/kotlin/com/hexated/SoraExtractor.kt index f44058d0..59757a47 100644 --- a/SoraStream/src/main/kotlin/com/hexated/SoraExtractor.kt +++ b/SoraStream/src/main/kotlin/com/hexated/SoraExtractor.kt @@ -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 diff --git a/SoraStream/src/main/kotlin/com/hexated/SoraUtils.kt b/SoraStream/src/main/kotlin/com/hexated/SoraUtils.kt index f5895a6e..3ca40d2d 100644 --- a/SoraStream/src/main/kotlin/com/hexated/SoraUtils.kt +++ b/SoraStream/src/main/kotlin/com/hexated/SoraUtils.kt @@ -49,6 +49,7 @@ import kotlin.math.min var watchflxCookies: Map? = null var filmxyCookies: Map? = 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) { + app.get( + "$wiwiApi/api/v1/app-config", + headers = headers + ).text + } + suspend fun checkCookies(session: String, headers: Map) { + 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 {