mirror of
https://github.com/hexated/cloudstream-extensions-hexated.git
synced 2024-08-15 00:03:22 +00:00
update
This commit is contained in:
parent
32a8516dc0
commit
ec7b24052b
1 changed files with 15 additions and 1 deletions
|
@ -36,12 +36,16 @@ open class Streampai : ExtractorApi() {
|
||||||
val res = app.get(url, referer = referer).document
|
val res = app.get(url, referer = referer).document
|
||||||
val data = res.selectFirst("script:containsData(player =)")?.data() ?: return
|
val data = res.selectFirst("script:containsData(player =)")?.data() ?: return
|
||||||
|
|
||||||
val sources = data.substringAfter("sources: [").substringBefore("]").replace("\'", "\"")
|
val sources = data.substringAfter("sources: [").substringBefore("]")
|
||||||
.addMarks("src")
|
.addMarks("src")
|
||||||
.addMarks("type")
|
.addMarks("type")
|
||||||
.addMarks("size")
|
.addMarks("size")
|
||||||
.replace("\'", "\"")
|
.replace("\'", "\"")
|
||||||
|
|
||||||
|
val tracks = data.substringAfter("tracks: [").substringBefore("]")
|
||||||
|
.replace("\'", "\"")
|
||||||
|
|
||||||
|
|
||||||
tryParseJson<List<Responses>>("[$sources]")?.forEach {
|
tryParseJson<List<Responses>>("[$sources]")?.forEach {
|
||||||
callback.invoke(
|
callback.invoke(
|
||||||
ExtractorLink(
|
ExtractorLink(
|
||||||
|
@ -56,6 +60,15 @@ open class Streampai : ExtractorApi() {
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tryParseJson<List<Responses>>("[$tracks]")?.forEach {
|
||||||
|
subtitleCallback.invoke(
|
||||||
|
SubtitleFile(
|
||||||
|
fixTitle(it.label ?: return@forEach),
|
||||||
|
fixUrl(it.src)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun String.addMarks(str: String): String {
|
private fun String.addMarks(str: String): String {
|
||||||
|
@ -65,6 +78,7 @@ open class Streampai : ExtractorApi() {
|
||||||
data class Responses(
|
data class Responses(
|
||||||
@JsonProperty("src") val src: String,
|
@JsonProperty("src") val src: String,
|
||||||
@JsonProperty("type") val type: String?,
|
@JsonProperty("type") val type: String?,
|
||||||
|
@JsonProperty("label") val label: String?,
|
||||||
@JsonProperty("size") val size: Int?
|
@JsonProperty("size") val size: Int?
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue