Skip to content

Commit

Permalink
Merge pull request #374 from MediaPortal/MP1-5236_Add_support_for_m3u…
Browse files Browse the repository at this point in the history
…8_files

MP1-5236: Add support for m3u8 files
  • Loading branch information
andrewjswan authored Mar 10, 2025
2 parents 66cf4d3 + 48b759a commit 44acdf4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion TvEngine3/TVLibrary/SetupTv/Sections/CardDvbIP.cs
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,16 @@ private string getUrlFromM3u8(string mainUrl)
string line = reader.ReadLine();
if (!line.StartsWith("#EXTM3U", StringComparison.InvariantCultureIgnoreCase))
return mainUrl;
bool prevLineIsStreamInf = false;

while ((line = reader.ReadLine()) != null)
{
if (line != string.Empty && !line.StartsWith("#"))
if (line.StartsWith("#"))
{
prevLineIsStreamInf = line.StartsWith("#EXT-X-STREAM-INF");
}
else
if (line != string.Empty && prevLineIsStreamInf)
{
int p = line.IndexOf('#');
if (p >= 0)
Expand Down

0 comments on commit 44acdf4

Please sign in to comment.