Udate vidoExtractor to take in account Wiflix ! Optimized FrenchStream to take directly the redirected link

This commit is contained in:
Eddy 2022-09-14 15:58:30 +02:00
parent b61b1c1213
commit 2d2f71a24a
2 changed files with 32 additions and 17 deletions

View File

@ -203,25 +203,30 @@ class FrenchStreamProvider : MainAPI() {
}
movieServers
}
val regeUpstream = Regex("""https:\\\/\\\/uptostream.com\\\/([^&]*)""")
val regeVido = Regex("""href\=\"https:\/\/vido\.lol\/(.*)\" target="_blank"><img""")
servers.apmap {
for (extractor in extractorApis) {
if (it.first.contains(extractor.name, ignoreCase = true)) {
val playerName = it.first
var playerUrl = when (!playerName.isNullOrEmpty()) {
playerName.contains("Uqload"), playerName.contains("UQLOAD") -> 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() {
}

View File

@ -13,7 +13,19 @@ class VidoExtractor : ExtractorApi() {
override val requiresReferer = true
override suspend fun getUrl(url: String, referer: String?): List<ExtractorLink>? {
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 ->