Skip to content

Commit

Permalink
fix intro not working on encrypted sources. looking for a fix
Browse files Browse the repository at this point in the history
  • Loading branch information
vynxc committed Jan 14, 2024
1 parent 367af01 commit c50ffe2
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion M3U8Proxy/M3U8Parser/FixUrlsToAbsolute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public static string FixAllUrls(string[] lines, string url, string prefix, strin
var parameters = GetParamsRegex().Match(url).Value;
var uri = new Uri(url);
const string uriPattern = @"URI=""([^""]+)""";
if (encrypted&&!isPlaylist)
if (encrypted&&!isPlaylist&&!IsEncoded(lines))
{
lines = InsertIntro(lines,baseUrl);
}
Expand Down Expand Up @@ -57,4 +57,13 @@ private static string[] InsertIntro(string[] lines,string baseUrl)
lines[lastIndex] = string.Join(Environment.NewLine, testToInsert);
return lines;
}
private static bool IsEncoded(string[] lines)
{
for (var i = 0; i < lines.Length || i < 10; i++)
{
if (lines[i].Contains("EXT-X-KEY"))
return true;
}
return false;
}
}

0 comments on commit c50ffe2

Please sign in to comment.