From 6fa564f9d3f3de72d3e6af742890b2812ce73497 Mon Sep 17 00:00:00 2001 From: hexated Date: Fri, 28 Jul 2023 19:36:39 +0700 Subject: [PATCH] sora: fix filmxy --- SoraStream/build.gradle.kts | 2 +- .../main/kotlin/com/hexated/SoraExtractor.kt | 23 +++++++------------ .../src/main/kotlin/com/hexated/SoraUtils.kt | 13 +++++------ 3 files changed, 15 insertions(+), 23 deletions(-) diff --git a/SoraStream/build.gradle.kts b/SoraStream/build.gradle.kts index 5420e8eb..1301ca94 100644 --- a/SoraStream/build.gradle.kts +++ b/SoraStream/build.gradle.kts @@ -1,7 +1,7 @@ import org.jetbrains.kotlin.konan.properties.Properties // use an integer for version numbers -version = 149 +version = 150 android { defaultConfig { diff --git a/SoraStream/src/main/kotlin/com/hexated/SoraExtractor.kt b/SoraStream/src/main/kotlin/com/hexated/SoraExtractor.kt index 969ddf78..2be73352 100644 --- a/SoraStream/src/main/kotlin/com/hexated/SoraExtractor.kt +++ b/SoraStream/src/main/kotlin/com/hexated/SoraExtractor.kt @@ -596,16 +596,16 @@ object SoraExtractor : SoraStream() { } else { "${filmxyAPI}/tv/$imdbId" } - val filmxyCookies = getFilmxyCookies(imdbId, season) + val filmxyCookies = getFilmxyCookies(imdbId, season) ?: return - val cookiesDoc = mapOf( + val cookies = mapOf( "G_ENABLED_IDPS" to "google", - "wordpress_logged_in_8bf9d5433ac88cc9a3a396d6b154cd01" to (filmxyCookies.wLog - ?: return), - "PHPSESSID" to (filmxyCookies.phpsessid ?: return) + "wp-secure-id" to "${filmxyCookies.wpSec}", + "wp-guest-token" to "${filmxyCookies.wpGuest}", + "PHPSESSID" to "${filmxyCookies.phpsessid}" ) - val doc = session.get(url, cookies = cookiesDoc).document + val doc = session.get(url, cookies = cookies).document val script = doc.selectFirst("script:containsData(var isSingle)")?.data() ?: return val sourcesData = @@ -644,16 +644,9 @@ object SoraExtractor : SoraStream() { "&linkIDs%5B%5D=$it" }?.replace("\"", "") - val body = "action=get_vid_links$linkIDs&user_id=$userId&nonce=$userNonce".toRequestBody() - val cookiesJson = mapOf( - "G_ENABLED_IDPS" to "google", - "PHPSESSID" to "${filmxyCookies.phpsessid}", - "wordpress_logged_in_8bf9d5433ac88cc9a3a396d6b154cd01" to "${filmxyCookies.wLog}", - "wordpress_sec_8bf9d5433ac88cc9a3a396d6b154cd01" to "${filmxyCookies.wSec}" - ) val json = app.post( "$filmxyAPI/wp-admin/admin-ajax.php", - requestBody = body, + requestBody = "action=get_vid_links$linkIDs&user_id=$userId&nonce=$userNonce".toRequestBody(), referer = url, headers = mapOf( "Accept" to "*/*", @@ -662,7 +655,7 @@ object SoraExtractor : SoraStream() { "Origin" to filmxyAPI, "X-Requested-With" to "XMLHttpRequest", ), - cookies = cookiesJson + cookies = cookies ).text.let { tryParseJson>(it) } sources?.map { source -> diff --git a/SoraStream/src/main/kotlin/com/hexated/SoraUtils.kt b/SoraStream/src/main/kotlin/com/hexated/SoraUtils.kt index a92603b6..20e9194c 100644 --- a/SoraStream/src/main/kotlin/com/hexated/SoraUtils.kt +++ b/SoraStream/src/main/kotlin/com/hexated/SoraUtils.kt @@ -107,8 +107,8 @@ val mimeType = arrayOf( data class FilmxyCookies( val phpsessid: String? = null, - val wLog: String? = null, - val wSec: String? = null, + val wpSec: String? = null, + val wpGuest: String? = null, ) fun String.filterIframe( @@ -901,7 +901,7 @@ suspend fun getTvMoviesServer(url: String, season: Int?, episode: Int?): Pair