Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
weblate committed Mar 3, 2025
2 parents 7d6ad2f + 127a9c0 commit aa24b65
Showing 1 changed file with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,17 @@ open class Filesim : ExtractorApi() {
subtitleCallback: (SubtitleFile) -> Unit,
callback: (ExtractorLink) -> Unit
) {
val embedUrl = url.replace("/download/", "/e/")
val response = app.get(embedUrl, referer = referer)
var response = app.get(url.replace("/download/", "/e/"), referer = referer)
val iframe = response.document.selectFirst("iframe")
if (iframe != null) {
response = app.get(
iframe.attr("src"), headers = mapOf(
"Accept-Language" to "en-US,en;q=0.5",
"Sec-Fetch-Dest" to "iframe"
), referer = response.url
)
}

var script = if (!getPacked(response.text).isNullOrEmpty()) {
getAndUnpack(response.text)
} else {
Expand All @@ -84,7 +93,7 @@ open class Filesim : ExtractorApi() {
}

val m3u8 =
Regex("file:\\s*\"(.*?m3u8.*?)\"").find(script ?: return)?.groupValues?.getOrNull(1)
Regex("file:\\s*\"(.*?m3u8.*?)\"").find(script)?.groupValues?.getOrNull(1)
generateM3u8(
name,
m3u8 ?: return,
Expand Down

0 comments on commit aa24b65

Please sign in to comment.