Skip to content

Commit

Permalink
Update SoraUtils.kt smashy (#436)
Browse files Browse the repository at this point in the history
  • Loading branch information
krishus96 authored Dec 8, 2023
1 parent 7dfce0f commit bb7e0e4
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions SoraStream/src/main/kotlin/com/hexated/SoraUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
)
}
Expand Down Expand Up @@ -1653,4 +1656,4 @@ object AESGCM {
dateFormat.timeZone = TimeZone.getTimeZone("GMT")
return dateFormat.format(Date())
}
}
}

0 comments on commit bb7e0e4

Please sign in to comment.