Create vtbe.kt

This commit is contained in:
phisher98 2024-03-27 21:28:42 +05:30 committed by GitHub
parent 0640de3fb4
commit a91e9cb3ce
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -0,0 +1,36 @@
package com.lagradost.cloudstream3.extractors
import android.util.Log
import com.fasterxml.jackson.annotation.JsonProperty
import com.lagradost.cloudstream3.app
import com.lagradost.cloudstream3.utils.*
import com.lagradost.cloudstream3.utils.AppUtils.tryParseJson
open class vtbe : ExtractorApi() {
override var name = "Vtbe"
override var mainUrl = "https://vtbe.to/"
override val requiresReferer = true
override suspend fun getUrl(url: String, referer: String?): List<ExtractorLink>? {
val response = app.get(url,referer=mainUrl).document
//println(response)
val extractedpack =response.selectFirst("script:containsData(function(p,a,c,k,e,d))")?.data().toString()
//val unpacked= getAndUnpack(extractedpack)
println(extractedpack)
JsUnpacker(extractedpack).unpack()?.let { unPacked ->
Regex("sources:\\[\\{file:\"(.*?)\"").find(unPacked)?.groupValues?.get(1)?.let { link ->
return listOf(
ExtractorLink(
this.name,
this.name,
link,
referer ?: "",
Qualities.Unknown.value,
URI(link).path.endsWith(".m3u8")
)
)
}
}
return null
}
}