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, ref: String,
callback: (ExtractorLink) -> Unit, callback: (ExtractorLink) -> Unit,
) { ) {
val json = app.get(url, referer = ref, headers = mapOf("X-Requested-With" to "XMLHttpRequest")) val res = app.get(url, referer = ref).text
.parsedSafe<SmashySources>() val source = Regex("['\"]?file['\"]?:\\s*\"([^\"]+)").find(res)?.groupValues?.get(1) ?: return
json?.sourceUrls?.map {
source.split(",").map { links ->
val quality = Regex("\\[(\\S+)]").find(links)?.groupValues?.getOrNull(1)?.trim()
val link = links.removePrefix("[$quality]").trim()
callback.invoke( callback.invoke(
ExtractorLink( ExtractorLink(
"Smashy [$name]", "Smashy [$name]",
"Smashy [$name]", "Smashy [$name]",
it, decode(link).replace("\\/", "/"),
if(name == "Player FM") "https://vidplay.site/" else "", smashyStreamAPI,
Qualities.P1080.value, getQualityFromName(quality),
INFER_TYPE INFER_TYPE,
) )
) )
} }
@ -1653,4 +1656,4 @@ object AESGCM {
dateFormat.timeZone = TimeZone.getTimeZone("GMT") dateFormat.timeZone = TimeZone.getTimeZone("GMT")
return dateFormat.format(Date()) return dateFormat.format(Date())
} }
} }