feat: added emturbovid extractor

This commit is contained in:
coxju 2024-01-17 10:35:07 +05:30
parent 399b28c75b
commit 5655ec79d9
2 changed files with 42 additions and 1 deletions

View file

@ -0,0 +1,39 @@
package com.lagradost.cloudstream3.extractors
import com.lagradost.cloudstream3.app
import com.lagradost.cloudstream3.utils.ExtractorApi
import com.lagradost.cloudstream3.utils.ExtractorLink
import com.lagradost.cloudstream3.utils.Qualities
open class EmturbovidExtractor : ExtractorApi() {
override var name = "Emturbovid"
override var mainUrl = "https://emturbovid.com"
override val requiresReferer = false
override suspend fun getUrl(url: String, referer: String?): List<ExtractorLink>? {
val response = app.get(
url, referer = referer ?: "$mainUrl/"
)
val playerScript =
response.document.selectXpath("//script[contains(text(),'var urlPlay')]")
.html()
val sources = mutableListOf<ExtractorLink>()
if (playerScript.isNotBlank()) {
val m3u8Url =
playerScript.substringAfter("var urlPlay = '").substringBefore("'")
sources.add(
ExtractorLink(
source = name,
name = name,
url = m3u8Url,
referer = "$mainUrl/",
quality = Qualities.Unknown.value,
isM3u8 = true
)
)
}
return sources
}
}

View file

@ -103,6 +103,7 @@ import com.lagradost.cloudstream3.extractors.Odnoklassniki
import com.lagradost.cloudstream3.extractors.TauVideo
import com.lagradost.cloudstream3.extractors.SibNet
import com.lagradost.cloudstream3.extractors.ContentX
import com.lagradost.cloudstream3.extractors.EmturbovidExtractor
import com.lagradost.cloudstream3.extractors.Hotlinger
import com.lagradost.cloudstream3.extractors.FourCX
import com.lagradost.cloudstream3.extractors.HDMomPlayer
@ -843,7 +844,8 @@ val extractorApis: MutableList<ExtractorApi> = arrayListOf(
Dokicloud(),
Megacloud(),
VidhideExtractor(),
StreamWishExtractor()
StreamWishExtractor(),
EmturbovidExtractor()
)