Unbruhed sflix.to and disabled 2embed

This commit is contained in:
Blatzar 2022-06-16 21:38:01 +02:00
parent 54a0913a8e
commit d233c83601
5 changed files with 34 additions and 29 deletions

View file

@ -354,6 +354,7 @@ class ZoroProvider : MainAPI() {
subtitleCallback, subtitleCallback,
// Blacklist VidCloud for now // Blacklist VidCloud for now
{ videoLink -> if (!videoLink.url.contains("betterstream")) callback(videoLink) }, { videoLink -> if (!videoLink.url.contains("betterstream")) callback(videoLink) },
true,
extractorData extractorData
) { sourceName -> ) { sourceName ->
sourceName + " - ${it.first}" sourceName + " - ${it.first}"

View file

@ -342,7 +342,7 @@ open class SflixProvider : MainAPI() {
val extractorData = val extractorData =
"https://ws11.rabbitstream.net/socket.io/?EIO=4&transport=polling" "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 { } else {
listOf(ExtractorLink( listOf(
caller.name, ExtractorLink(
caller.name, caller.name,
file, caller.name,
caller.mainUrl, file,
getQualityFromName(this.label), caller.mainUrl,
false, getQualityFromName(this.label),
extractorData = extractorData false,
)) extractorData = extractorData
)
)
} }
} }
} }
@ -633,9 +635,10 @@ open class SflixProvider : MainAPI() {
url: String, url: String,
subtitleCallback: (SubtitleFile) -> Unit, subtitleCallback: (SubtitleFile) -> Unit,
callback: (ExtractorLink) -> Unit, callback: (ExtractorLink) -> Unit,
useSidAuthentication: Boolean,
/** Used for extractorLink name, input: Source name */ /** Used for extractorLink name, input: Source name */
extractorData: String, extractorData: String? = null,
nameTransformer: (String) -> String nameTransformer: (String) -> String,
) = suspendSafeApiCall { ) = suspendSafeApiCall {
// https://rapid-cloud.ru/embed-6/dcPOVRE57YOT?z= -> https://rapid-cloud.ru/embed-6 // https://rapid-cloud.ru/embed-6/dcPOVRE57YOT?z= -> https://rapid-cloud.ru/embed-6
val mainIframeUrl = val mainIframeUrl =
@ -651,20 +654,21 @@ open class SflixProvider : MainAPI() {
Regex("""recaptchaNumber = '(.*?)'""").find(iframe.text)?.groupValues?.get(1) Regex("""recaptchaNumber = '(.*?)'""").find(iframe.text)?.groupValues?.get(1)
var sid: String? = null 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 { sid = parseJson<PollingData>(text).sid
app.post( ioSafe { app.get("$extractorData&t=${generateTimeStamp()}&sid=${it.sid}") }
"$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<PollingData>(text).sid
ioSafe { app.get("$extractorData&t=${generateTimeStamp()}&sid=${it.sid}") }
} }
val mapped = app.get( val mapped = app.get(
@ -673,7 +677,7 @@ open class SflixProvider : MainAPI() {
"/embed", "/embed",
"/ajax/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, referer = mainUrl,
headers = mapOf( headers = mapOf(
"X-Requested-With" to "XMLHttpRequest", "X-Requested-With" to "XMLHttpRequest",

View file

@ -61,7 +61,7 @@ class TwoEmbedProvider : TmdbProvider() {
val mappedservers = parseJson<EmbedJson>(ajax) val mappedservers = parseJson<EmbedJson>(ajax)
val iframeLink = mappedservers.link val iframeLink = mappedservers.link
if (iframeLink.contains("rabbitstream")) { 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 { } else {
loadExtractor(iframeLink, embedUrl, callback) loadExtractor(iframeLink, embedUrl, callback)
} }

View file

@ -379,7 +379,7 @@
"TwoEmbedProvider": { "TwoEmbedProvider": {
"language": "en", "language": "en",
"name": "2Embed", "name": "2Embed",
"status": 1, "status": 0,
"url": "https://www.2embed.ru" "url": "https://www.2embed.ru"
}, },
"VMoveeProvider": { "VMoveeProvider": {

View file

@ -242,7 +242,7 @@
"TwoEmbedProvider": { "TwoEmbedProvider": {
"name": "2Embed", "name": "2Embed",
"url": "https://www.2embed.ru", "url": "https://www.2embed.ru",
"status": 1 "status": 0
}, },
"VMoveeProvider": { "VMoveeProvider": {
"name": "VMovee", "name": "VMovee",