Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
alex committed Jan 17, 2024
1 parent 32a8516 commit ec7b240
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion Minioppai/src/main/kotlin/com/hexated/Extractors.kt
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,16 @@ open class Streampai : ExtractorApi() {
val res = app.get(url, referer = referer).document
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("type")
.addMarks("size")
.replace("\'", "\"")

val tracks = data.substringAfter("tracks: [").substringBefore("]")
.replace("\'", "\"")


tryParseJson<List<Responses>>("[$sources]")?.forEach {
callback.invoke(
ExtractorLink(
Expand All @@ -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 {
Expand All @@ -65,6 +78,7 @@ open class Streampai : ExtractorApi() {
data class Responses(
@JsonProperty("src") val src: String,
@JsonProperty("type") val type: String?,
@JsonProperty("label") val label: String?,
@JsonProperty("size") val size: Int?
)

Expand Down

0 comments on commit ec7b240

Please sign in to comment.