From 2d2f71a24a360d6de1d2a5f4313e92b2b8a97276 Mon Sep 17 00:00:00 2001 From: Eddy Date: Wed, 14 Sep 2022 15:58:30 +0200 Subject: [PATCH] Udate vidoExtractor to take in account Wiflix ! Optimized FrenchStream to take directly the redirected link --- .../com/lagradost/FrenchStreamProvider.kt | 35 ++++++++++--------- .../kotlin/com/lagradost/VidoExtractor.kt | 14 +++++++- 2 files changed, 32 insertions(+), 17 deletions(-) diff --git a/FrenchStreamProvider/src/main/kotlin/com/lagradost/FrenchStreamProvider.kt b/FrenchStreamProvider/src/main/kotlin/com/lagradost/FrenchStreamProvider.kt index 9757b95..e6e4845 100644 --- a/FrenchStreamProvider/src/main/kotlin/com/lagradost/FrenchStreamProvider.kt +++ b/FrenchStreamProvider/src/main/kotlin/com/lagradost/FrenchStreamProvider.kt @@ -203,25 +203,30 @@ class FrenchStreamProvider : MainAPI() { } movieServers } - val regeUpstream = Regex("""https:\\\/\\\/uptostream.com\\\/([^&]*)""") - val regeVido = Regex("""href\=\"https:\/\/vido\.lol\/(.*)\" target="_blank"> it.second - playerName.contains("Uptostream"), playerName.contains("UPTOSTREAM") -> "https://uptostream.com/iframe/" + (regeUpstream.find( - app.get("https" + it.second.split("https").get(1)).text // need to do the extractor - )?.groupValues?.get(1) - ?: "") - playerName.contains("ViDO"), playerName.contains("VIDO") -> "https://vido.lol/embed-" + (regeVido.find( - app.get("https" + it.second.split("https").get(1)).text - )?.groupValues?.get(1)) + ".html" + var playerName = it.first - else -> "" + if (playerName.contains("Stream.B")) { + playerName = it.first.replace("Stream.B", "StreamSB") + } + if (playerName.contains(extractor.name, ignoreCase = true)) { + val header = app.get( + "https" + it.second.split("https").get(1), + allowRedirects = false + ).headers + println(header) + val urlplayer = it.second + var playerUrl = when (!urlplayer.isNullOrEmpty()) { + urlplayer.contains("uqload") -> it.second + urlplayer.contains("opsktp.com") -> header.get("location") + .toString() // case where there is redirection to opsktp + + else -> it.second } extractor.getSafeUrl(playerUrl, playerUrl, subtitleCallback, callback) + break } } } @@ -302,5 +307,3 @@ class FrenchStreamProvider : MainAPI() { } - - diff --git a/FrenchStreamProvider/src/main/kotlin/com/lagradost/VidoExtractor.kt b/FrenchStreamProvider/src/main/kotlin/com/lagradost/VidoExtractor.kt index 75269ad..32f5517 100644 --- a/FrenchStreamProvider/src/main/kotlin/com/lagradost/VidoExtractor.kt +++ b/FrenchStreamProvider/src/main/kotlin/com/lagradost/VidoExtractor.kt @@ -13,7 +13,19 @@ class VidoExtractor : ExtractorApi() { override val requiresReferer = true override suspend fun getUrl(url: String, referer: String?): List? { - with(app.get(url)) { + val methode = if (url.contains("embed")) { + app.get(url) // french stream + } else { + val code = url.substringAfterLast("/") + val data = mapOf( + "op" to "embed", + "file_code" to code, + "&auto" to "1" + + ) + app.post("https://vido.lol/dl", referer = url, data = data) // wiflix + } + with(methode) { getAndUnpack(this.text).let { unpackedText -> //val quality = unpackedText.lowercase().substringAfter(" height=").substringBefore(" ").toIntOrNull() srcRegex.find(unpackedText)?.groupValues?.get(1)?.let { link ->