mirror of
https://github.com/recloudstream/cloudstream.git
synced 2024-08-15 01:53:11 +00:00
update
This commit is contained in:
parent
d92e7093fc
commit
2876f00545
1 changed files with 17 additions and 17 deletions
|
@ -22,15 +22,13 @@ 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>()
|
||||||
val response = app.get(url, referer = referer)
|
val response = app.get(url, referer = referer)
|
||||||
val scriptElements = response.document.select("script")
|
val scriptElements = response.document.select("script").map { script ->
|
||||||
for (script in scriptElements) {
|
|
||||||
if (script.data().contains("eval(function(p,a,c,k,e,d)")) {
|
if (script.data().contains("eval(function(p,a,c,k,e,d)")) {
|
||||||
val data = getAndUnpack(script.data()).substringAfter("sources: [")
|
val data = getAndUnpack(script.data()).substringAfter("sources: [").substringBefore("],").replace("file", "\"file\"").trim()
|
||||||
.substringBefore("],").replace("file", "\"file\"").trim()
|
tryParseJson<File>(data)?.let {
|
||||||
tryParseJson<List<File>>(data)?.let {
|
|
||||||
M3u8Helper.generateM3u8(
|
M3u8Helper.generateM3u8(
|
||||||
name,
|
name,
|
||||||
it.map { file -> file.file },
|
it.file,
|
||||||
"$mainUrl/",
|
"$mainUrl/",
|
||||||
).forEach { m3uData -> sources.add(m3uData) }
|
).forEach { m3uData -> sources.add(m3uData) }
|
||||||
}
|
}
|
||||||
|
@ -42,4 +40,6 @@ open class StreamoUpload : ExtractorApi() {
|
||||||
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