mirror of
https://github.com/hexated/cloudstream-extensions-hexated.git
synced 2024-08-15 00:03:22 +00:00
fix #258
This commit is contained in:
parent
18c07cc069
commit
67896f1d69
1 changed files with 7 additions and 3 deletions
|
@ -2206,6 +2206,9 @@ object SoraExtractor : SoraStream() {
|
|||
episode: Int? = null,
|
||||
callback: (ExtractorLink) -> Unit,
|
||||
) {
|
||||
fun String.decrypt(key: String) : List<PrimewireSources>? {
|
||||
return tryParseJson<List<PrimewireSources>>(base64Decode(this).decodePrimewireXor(key))
|
||||
}
|
||||
val slug = getEpisodeSlug(season, episode)
|
||||
val query = if (season == null) {
|
||||
title
|
||||
|
@ -2260,7 +2263,9 @@ object SoraExtractor : SoraStream() {
|
|||
"$primewireAPI$serverUrl",
|
||||
cookies = cookies, referer = url, headers = headers
|
||||
)
|
||||
val key = getAndUnpack(serverRes.text).substringAfter("(key=").substringBefore(")")
|
||||
val unpack = getAndUnpack(serverRes.text)
|
||||
val key = unpack.substringAfter("(key=").substringBefore(")")
|
||||
val key2 = unpack.substringAfter("<\"").substringBefore("\".")
|
||||
serverRes.document.select("ul li").amap { el ->
|
||||
val server = el.attr("data-value")
|
||||
val encryptedData = app.get(
|
||||
|
@ -2269,8 +2274,7 @@ object SoraExtractor : SoraStream() {
|
|||
referer = url,
|
||||
headers = headers
|
||||
).text
|
||||
val json = base64Decode(encryptedData).decodePrimewireXor(key)
|
||||
val links = tryParseJson<List<PrimewireSources>>(json) ?: return@amap
|
||||
val links = encryptedData.decrypt(key) ?: encryptedData.decrypt(key2) ?: return@amap
|
||||
links.forEach { video ->
|
||||
qualities.filter { it <= video.max.toInt() }.forEach {
|
||||
callback(
|
||||
|
|
Loading…
Reference in a new issue