mirror of
https://github.com/recloudstream/cloudstream.git
synced 2024-08-15 01:53:11 +00:00
5dfc08aabb
Co-authored-by: coxju <coxju>
39 lines
1.3 KiB
Kotlin
39 lines
1.3 KiB
Kotlin
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
|
|
}
|
|
} |