simple fix for xcine

This commit is contained in:
Blatzar 2022-07-25 20:21:39 +02:00
parent 6f984c7a92
commit 338bf4287a

View file

@ -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
}
files.forEach { (isVip, list) ->
list.forEach file@{ file ->
if (file.file == null) return@file
callback.invoke( callback.invoke(
ExtractorLink( ExtractorLink(
this.name, this.name,
this.name + if (isVip) " VIP" else "", this.name,
file.file.replace("\\", ""), link.replace("\\", ""),
this.mainUrl, this.mainUrl,
file.label?.getIntFromText() ?: Qualities.Unknown.value, // file.label?.getIntFromText() ?:
file.type?.contains("hls", ignoreCase = true) == true, Qualities.Unknown.value,
true
// file.type?.contains("hls", ignoreCase = true) == true,
) )
) )
} // }
} // }
return files.sumOf { it.second.size } > 0 return true // files.sumOf { it.second.size } > 0
} }
} }