Added Vido Provider to base cloudstream

This commit is contained in:
Sarlay 2023-02-25 08:50:39 +00:00 committed by GitHub
parent c49029d010
commit 1a66b51e52
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 0 additions and 47 deletions

View File

@ -1,47 +0,0 @@
package com.lagradost
import com.lagradost.cloudstream3.app
import com.lagradost.cloudstream3.utils.ExtractorApi
import com.lagradost.cloudstream3.utils.ExtractorLink
import com.lagradost.cloudstream3.utils.Qualities
import com.lagradost.cloudstream3.utils.getAndUnpack
class VidoExtractor : ExtractorApi() {
override var name = "Vido"
override var mainUrl = "https://vido.lol"
private val srcRegex = Regex("""layer\(\{sources\:\["(.*)"\]""")
override val requiresReferer = true
override suspend fun getUrl(url: String, referer: String?): List<ExtractorLink>? {
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 ->
return listOf(
ExtractorLink(
name,
name,
link,
url,
Qualities.Unknown.value,
true,
)
)
}
}
}
return null
}
}