From d233c8360175740b10317a2a52f994db201409a3 Mon Sep 17 00:00:00 2001 From: Blatzar <46196380+Blatzar@users.noreply.github.com> Date: Thu, 16 Jun 2022 21:38:01 +0200 Subject: [PATCH] Unbruhed sflix.to and disabled 2embed --- .../animeproviders/ZoroProvider.kt | 1 + .../movieproviders/SflixProvider.kt | 56 ++++++++++--------- .../movieproviders/TwoEmbedProvider.kt | 2 +- docs/providers.json | 2 +- providers.json | 2 +- 5 files changed, 34 insertions(+), 29 deletions(-) diff --git a/app/src/main/java/com/lagradost/cloudstream3/animeproviders/ZoroProvider.kt b/app/src/main/java/com/lagradost/cloudstream3/animeproviders/ZoroProvider.kt index 24751a36..2200f2c7 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/animeproviders/ZoroProvider.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/animeproviders/ZoroProvider.kt @@ -354,6 +354,7 @@ class ZoroProvider : MainAPI() { subtitleCallback, // Blacklist VidCloud for now { videoLink -> if (!videoLink.url.contains("betterstream")) callback(videoLink) }, + true, extractorData ) { sourceName -> sourceName + " - ${it.first}" diff --git a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/SflixProvider.kt b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/SflixProvider.kt index 74ae4129..5536906d 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/SflixProvider.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/SflixProvider.kt @@ -342,7 +342,7 @@ open class SflixProvider : MainAPI() { val extractorData = "https://ws11.rabbitstream.net/socket.io/?EIO=4&transport=polling" - extractRabbitStream(iframeLink, subtitleCallback, callback, extractorData) { it } + extractRabbitStream(iframeLink, subtitleCallback, callback, false) { it } } } @@ -607,15 +607,17 @@ open class SflixProvider : MainAPI() { ) } } else { - listOf(ExtractorLink( - caller.name, - caller.name, - file, - caller.mainUrl, - getQualityFromName(this.label), - false, - extractorData = extractorData - )) + listOf( + ExtractorLink( + caller.name, + caller.name, + file, + caller.mainUrl, + getQualityFromName(this.label), + false, + extractorData = extractorData + ) + ) } } } @@ -633,9 +635,10 @@ open class SflixProvider : MainAPI() { url: String, subtitleCallback: (SubtitleFile) -> Unit, callback: (ExtractorLink) -> Unit, + useSidAuthentication: Boolean, /** Used for extractorLink name, input: Source name */ - extractorData: String, - nameTransformer: (String) -> String + extractorData: String? = null, + nameTransformer: (String) -> String, ) = suspendSafeApiCall { // https://rapid-cloud.ru/embed-6/dcPOVRE57YOT?z= -> https://rapid-cloud.ru/embed-6 val mainIframeUrl = @@ -651,20 +654,21 @@ open class SflixProvider : MainAPI() { Regex("""recaptchaNumber = '(.*?)'""").find(iframe.text)?.groupValues?.get(1) var sid: String? = null + if (useSidAuthentication && extractorData != null) { + negotiateNewSid(extractorData)?.also { + app.post( + "$extractorData&t=${generateTimeStamp()}&sid=${it.sid}", + requestBody = "40".toRequestBody(), + timeout = 60 + ) + val text = app.get( + "$extractorData&t=${generateTimeStamp()}&sid=${it.sid}", + timeout = 60 + ).text.replaceBefore("{", "") - negotiateNewSid(extractorData)?.also { - app.post( - "$extractorData&t=${generateTimeStamp()}&sid=${it.sid}", - requestBody = "40".toRequestBody(), - timeout = 60 - ) - val text = app.get( - "$extractorData&t=${generateTimeStamp()}&sid=${it.sid}", - timeout = 60 - ).text.replaceBefore("{", "") - - sid = parseJson(text).sid - ioSafe { app.get("$extractorData&t=${generateTimeStamp()}&sid=${it.sid}") } + sid = parseJson(text).sid + ioSafe { app.get("$extractorData&t=${generateTimeStamp()}&sid=${it.sid}") } + } } val mapped = app.get( @@ -673,7 +677,7 @@ open class SflixProvider : MainAPI() { "/embed", "/ajax/embed" ) - }/getSources?id=$mainIframeId&_token=$iframeToken&_number=$number$&sId=${sid!!}", + }/getSources?id=$mainIframeId&_token=$iframeToken&_number=$number${sid?.let { "$&sId=$it" } ?: ""}", referer = mainUrl, headers = mapOf( "X-Requested-With" to "XMLHttpRequest", diff --git a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/TwoEmbedProvider.kt b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/TwoEmbedProvider.kt index b55a65b4..d595c1f0 100644 --- a/app/src/main/java/com/lagradost/cloudstream3/movieproviders/TwoEmbedProvider.kt +++ b/app/src/main/java/com/lagradost/cloudstream3/movieproviders/TwoEmbedProvider.kt @@ -61,7 +61,7 @@ class TwoEmbedProvider : TmdbProvider() { val mappedservers = parseJson(ajax) val iframeLink = mappedservers.link if (iframeLink.contains("rabbitstream")) { - extractRabbitStream(iframeLink, subtitleCallback, callback, "https://ws10.rabbitstream.net/socket.io/?EIO=4&transport=polling") { it } + extractRabbitStream(iframeLink, subtitleCallback, callback, false) { it } } else { loadExtractor(iframeLink, embedUrl, callback) } diff --git a/docs/providers.json b/docs/providers.json index 831aee10..b03124e4 100644 --- a/docs/providers.json +++ b/docs/providers.json @@ -379,7 +379,7 @@ "TwoEmbedProvider": { "language": "en", "name": "2Embed", - "status": 1, + "status": 0, "url": "https://www.2embed.ru" }, "VMoveeProvider": { diff --git a/providers.json b/providers.json index d9c57ce6..7f89bfd6 100644 --- a/providers.json +++ b/providers.json @@ -242,7 +242,7 @@ "TwoEmbedProvider": { "name": "2Embed", "url": "https://www.2embed.ru", - "status": 1 + "status": 0 }, "VMoveeProvider": { "name": "VMovee",