mirror of
https://github.com/recloudstream/cloudstream.git
synced 2024-08-15 01:53:11 +00:00
up
This commit is contained in:
parent
1c6c99a4e8
commit
10a9996228
1 changed files with 19 additions and 19 deletions
|
@ -1,5 +1,3 @@
|
||||||
package com.lagradost.cloudstream3.extractors
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty
|
import com.fasterxml.jackson.annotation.JsonProperty
|
||||||
import com.lagradost.cloudstream3.app
|
import com.lagradost.cloudstream3.app
|
||||||
import com.lagradost.cloudstream3.utils.AppUtils.tryParseJson
|
import com.lagradost.cloudstream3.utils.AppUtils.tryParseJson
|
||||||
|
@ -21,28 +19,30 @@ open class StreamoUpload : ExtractorApi() {
|
||||||
|
|
||||||
override suspend fun getUrl(url: String, referer: String?): List<ExtractorLink> {
|
override suspend fun getUrl(url: String, referer: String?): List<ExtractorLink> {
|
||||||
val sources = mutableListOf<ExtractorLink>()
|
val sources = mutableListOf<ExtractorLink>()
|
||||||
app.get(url, referer = referer).document.select("script").map {it.data() }
|
app.get(url, referer = referer).document.select("script").map { it.data() }
|
||||||
.filter { it.contains("eval(function(p,a,c,k,e,d)") }
|
.filter { it.contains("eval(function(p,a,c,k,e,d)") }
|
||||||
.map { script ->
|
.map { script ->
|
||||||
val unpacked = if (script.contains("m3u8")) getAndUnpack(script)
|
val unpacked = if (script.contains("m3u8")) {
|
||||||
if (script.data().contains("jwplayer(\"vplayer\").setup(")) {
|
getAndUnpack(script)
|
||||||
val data = script.data().substringAfter("sources: [")
|
} else {
|
||||||
.substringBefore("],").replace("file", "\"file\"").trim()
|
null
|
||||||
tryParseJson<File>(data)?.let {
|
}
|
||||||
M3u8Helper.generateM3u8(
|
if (script.contains("jwplayer(\"vplayer\").setup(")) {
|
||||||
name,
|
val data = script.substringAfter("sources: [")
|
||||||
it.file,
|
.substringBefore("],").replace("file", "\"file\"").trim()
|
||||||
"$mainUrl/",
|
tryParseJson<File>(data)?.let {
|
||||||
).forEach { m3uData -> sources.add(m3uData) }
|
M3u8Helper.generateM3u8(
|
||||||
|
name,
|
||||||
|
it.file,
|
||||||
|
"$mainUrl/",
|
||||||
|
).forEach { m3uData -> sources.add(m3uData) }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return sources
|
return sources
|
||||||
}
|
}
|
||||||
|
|
||||||
private data class File(
|
private data class File(
|
||||||
@JsonProperty("file") val file: String,
|
@JsonProperty("file") val file: String,
|
||||||
)
|
)
|
||||||
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue