forked from recloudstream/cloudstream
simple fix for xcine
This commit is contained in:
parent
6f984c7a92
commit
338bf4287a
1 changed files with 20 additions and 23 deletions
|
@ -231,30 +231,27 @@ class XcineProvider : MainAPI() {
|
||||||
cookies = parsed.cookies + cookies,
|
cookies = parsed.cookies + cookies,
|
||||||
).text
|
).text
|
||||||
|
|
||||||
val jsonRegex = Regex("""(vip_|)source.*?(\[.*);""")
|
val urlRegex = Regex("""file['"].*?['"]([^'"]*)""")
|
||||||
val json = jsonRegex.findAll(response)
|
val link = urlRegex.find(response)?.groupValues!![1]
|
||||||
|
|
||||||
val files = json.mapNotNull {
|
// files.forEach { (isVip, list) ->
|
||||||
(it.groupValues.getOrNull(1) == "vip_") to (
|
// list.forEach file@{ file ->
|
||||||
tryParseJson<List<File>>(it.groupValues.getOrNull(2)) ?: return@mapNotNull null)
|
// if (file.file == null) return@file
|
||||||
}
|
callback.invoke(
|
||||||
|
ExtractorLink(
|
||||||
|
this.name,
|
||||||
|
this.name,
|
||||||
|
link.replace("\\", ""),
|
||||||
|
this.mainUrl,
|
||||||
|
// file.label?.getIntFromText() ?:
|
||||||
|
Qualities.Unknown.value,
|
||||||
|
true
|
||||||
|
// file.type?.contains("hls", ignoreCase = true) == true,
|
||||||
|
)
|
||||||
|
)
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
files.forEach { (isVip, list) ->
|
return true // files.sumOf { it.second.size } > 0
|
||||||
list.forEach file@{ file ->
|
|
||||||
if (file.file == null) return@file
|
|
||||||
callback.invoke(
|
|
||||||
ExtractorLink(
|
|
||||||
this.name,
|
|
||||||
this.name + if (isVip) " VIP" else "",
|
|
||||||
file.file.replace("\\", ""),
|
|
||||||
this.mainUrl,
|
|
||||||
file.label?.getIntFromText() ?: Qualities.Unknown.value,
|
|
||||||
file.type?.contains("hls", ignoreCase = true) == true,
|
|
||||||
)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return files.sumOf { it.second.size } > 0
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue