sora: fixed ask4movies

This commit is contained in:
hexated 2023-07-24 21:25:57 +07:00
parent 22b5f99e48
commit c1d59c7f8e
13 changed files with 316 additions and 49 deletions

View file

@ -1,37 +0,0 @@
package com.hexated
import com.fasterxml.jackson.annotation.JsonProperty
import com.lagradost.cloudstream3.SubtitleFile
import com.lagradost.cloudstream3.app
import com.lagradost.cloudstream3.extractors.SpeedoStream
import com.lagradost.cloudstream3.utils.AppUtils
import com.lagradost.cloudstream3.utils.ExtractorLink
import com.lagradost.cloudstream3.utils.M3u8Helper
import com.lagradost.cloudstream3.utils.getAndUnpack
class Streamoupload : SpeedoStream() {
override val mainUrl = "https://streamoupload.xyz"
override val name = "Streamoupload"
override suspend fun getUrl(
url: String,
referer: String?,
subtitleCallback: (SubtitleFile) -> Unit,
callback: (ExtractorLink) -> Unit
) {
val script = getAndUnpack(app.get(url, referer = referer).text)
val data = script.substringAfter("sources:[")
.substringBefore("],").replace("file", "\"file\"").trim()
AppUtils.tryParseJson<File>(data)?.let {
M3u8Helper.generateM3u8(
name,
it.file,
"$mainUrl/",
).forEach(callback)
}
}
private data class File(
@JsonProperty("file") val file: String,
)
}

View file

@ -11,6 +11,5 @@ class YomoviesProviderPlugin: Plugin() {
// All providers should be added in this manner. Please don't edit the providers list directly.
registerMainAPI(YomoviesProvider())
registerMainAPI(Watchomovies())
registerExtractorAPI(Streamoupload())
}
}