Update SoraUtils.kt smashy (#436)

This commit is contained in:
krishus96 2023-12-09 01:32:23 +05:30 committed by GitHub
parent 7dfce0f19e
commit bb7e0e41c2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -449,17 +449,20 @@ suspend fun invokeSmashyFfix(
ref: String,
callback: (ExtractorLink) -> Unit,
) {
val json = app.get(url, referer = ref, headers = mapOf("X-Requested-With" to "XMLHttpRequest"))
.parsedSafe<SmashySources>()
json?.sourceUrls?.map {
val res = app.get(url, referer = ref).text
val source = Regex("['\"]?file['\"]?:\\s*\"([^\"]+)").find(res)?.groupValues?.get(1) ?: return
source.split(",").map { links ->
val quality = Regex("\\[(\\S+)]").find(links)?.groupValues?.getOrNull(1)?.trim()
val link = links.removePrefix("[$quality]").trim()
callback.invoke(
ExtractorLink(
"Smashy [$name]",
"Smashy [$name]",
it,
if(name == "Player FM") "https://vidplay.site/" else "",
Qualities.P1080.value,
INFER_TYPE
decode(link).replace("\\/", "/"),
smashyStreamAPI,
getQualityFromName(quality),
INFER_TYPE,
)
)
}