mirror of
https://github.com/recloudstream/cloudstream.git
synced 2024-08-15 01:53:11 +00:00
feat: added xtreamestream extractor
This commit is contained in:
parent
01f21e0fe8
commit
df1d5446a0
2 changed files with 42 additions and 1 deletions
|
@ -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.M3u8Helper
|
||||
|
||||
open class Xtremestream : ExtractorApi() {
|
||||
override var name = "Xtremestream"
|
||||
override var mainUrl = "xtremestream.co"
|
||||
override val requiresReferer = false
|
||||
|
||||
override suspend fun getUrl(url: String, referer: String?): List<ExtractorLink>? {
|
||||
val response = app.get(
|
||||
url, referer = "https://${url.substringAfter("//").substringBefore("/")}/",
|
||||
)
|
||||
val playerScript =
|
||||
response.document.selectXpath("//script[contains(text(),'var video_id')]")
|
||||
.html()
|
||||
|
||||
val sources = mutableListOf<ExtractorLink>()
|
||||
if (playerScript.isNotBlank()) {
|
||||
val videoId = playerScript.substringAfter("var video_id = `").substringBefore("`;")
|
||||
val m3u8LoaderUrl =
|
||||
playerScript.substringAfter("var m3u8_loader_url = `").substringBefore("`;")
|
||||
|
||||
if (videoId.isNotBlank() && m3u8LoaderUrl.isNotBlank()) {
|
||||
M3u8Helper.generateM3u8(
|
||||
name,
|
||||
"$m3u8LoaderUrl/$videoId",
|
||||
"$m3u8LoaderUrl/$videoId"
|
||||
).forEach { link ->
|
||||
sources.add(link)
|
||||
}
|
||||
}
|
||||
}
|
||||
return sources
|
||||
}
|
||||
}
|
|
@ -204,6 +204,7 @@ import com.lagradost.cloudstream3.extractors.Watchx
|
|||
import com.lagradost.cloudstream3.extractors.WcoStream
|
||||
import com.lagradost.cloudstream3.extractors.Wibufile
|
||||
import com.lagradost.cloudstream3.extractors.XStreamCdn
|
||||
import com.lagradost.cloudstream3.extractors.Xtremestream
|
||||
import com.lagradost.cloudstream3.extractors.YourUpload
|
||||
import com.lagradost.cloudstream3.extractors.YoutubeExtractor
|
||||
import com.lagradost.cloudstream3.extractors.YoutubeMobileExtractor
|
||||
|
@ -858,7 +859,8 @@ val extractorApis: MutableList<ExtractorApi> = arrayListOf(
|
|||
Megacloud(),
|
||||
VidhideExtractor(),
|
||||
StreamWishExtractor(),
|
||||
EmturbovidExtractor()
|
||||
EmturbovidExtractor(),
|
||||
Xtremestream()
|
||||
)
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue