2023-08-01 23:30:41 +00:00
|
|
|
package com.hexated
|
|
|
|
|
|
|
|
import com.fasterxml.jackson.annotation.JsonProperty
|
|
|
|
import com.lagradost.cloudstream3.SubtitleFile
|
|
|
|
import com.lagradost.cloudstream3.app
|
|
|
|
import com.lagradost.cloudstream3.fixTitle
|
|
|
|
import com.lagradost.cloudstream3.utils.AppUtils.tryParseJson
|
|
|
|
import com.lagradost.cloudstream3.utils.ExtractorApi
|
|
|
|
import com.lagradost.cloudstream3.utils.ExtractorLink
|
|
|
|
import com.lagradost.cloudstream3.utils.fixUrl
|
|
|
|
import com.lagradost.cloudstream3.utils.getAndUnpack
|
|
|
|
import com.lagradost.cloudstream3.utils.getQualityFromName
|
|
|
|
|
2023-08-07 14:17:34 +00:00
|
|
|
class Paistream : Streampai() {
|
|
|
|
override val name = "Paistream"
|
|
|
|
override val mainUrl = "https://paistream.my.id"
|
|
|
|
}
|
|
|
|
|
2023-09-03 02:12:38 +00:00
|
|
|
class TvMinioppai : Streampai() {
|
2023-09-09 12:16:04 +00:00
|
|
|
override val name = "Minioppai"
|
2023-09-03 02:12:38 +00:00
|
|
|
override val mainUrl = "https://tv.minioppai.org"
|
|
|
|
}
|
|
|
|
|
2023-08-01 23:30:41 +00:00
|
|
|
open class Streampai : ExtractorApi() {
|
|
|
|
override val name = "Streampai"
|
|
|
|
override val mainUrl = "https://streampai.my.id"
|
|
|
|
override val requiresReferer = true
|
|
|
|
|
|
|
|
override suspend fun getUrl(
|
|
|
|
url: String,
|
|
|
|
referer: String?,
|
|
|
|
subtitleCallback: (SubtitleFile) -> Unit,
|
|
|
|
callback: (ExtractorLink) -> Unit
|
|
|
|
) {
|
|
|
|
val res = app.get(url, referer = referer).text
|
|
|
|
val data = getAndUnpack(res)
|
|
|
|
|
|
|
|
val sources = data.substringAfter("sources:[").substringBefore("]").replace("\'", "\"")
|
|
|
|
val tracks = data.substringAfter("\"tracks\":[").substringBefore("]")
|
|
|
|
|
|
|
|
tryParseJson<List<Responses>>("[$sources]")?.forEach {
|
|
|
|
callback.invoke(
|
|
|
|
ExtractorLink(
|
|
|
|
this.name,
|
|
|
|
this.name,
|
|
|
|
fixUrl(it.file),
|
2023-12-06 04:15:42 +00:00
|
|
|
url,
|
2023-08-01 23:30:41 +00:00
|
|
|
getQualityFromName(it.label),
|
|
|
|
headers = mapOf(
|
|
|
|
"Accept" to "video/webm,video/ogg,video/*;q=0.9,application/ogg;q=0.7,audio/*;q=0.6,*/*;q=0.5",
|
2023-12-06 04:15:42 +00:00
|
|
|
"Accept-Language" to "en-US,en;q=0.5",
|
|
|
|
"DNT" to "1",
|
2023-08-01 23:30:41 +00:00
|
|
|
"Range" to "bytes=0-",
|
|
|
|
"Sec-Fetch-Dest" to "video",
|
|
|
|
"Sec-Fetch-Mode" to "no-cors",
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
tryParseJson<List<Responses>>("[$tracks]")?.forEach {
|
|
|
|
subtitleCallback.invoke(
|
|
|
|
SubtitleFile(
|
|
|
|
fixTitle(it.label ?: ""),
|
|
|
|
fixUrl(it.file),
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
data class Responses(
|
|
|
|
@JsonProperty("file") val file: String,
|
|
|
|
@JsonProperty("type") val type: String?,
|
|
|
|
@JsonProperty("label") val label: String?
|
|
|
|
)
|
|
|
|
|
|
|
|
}
|