Skip to content

Commit

Permalink
Fixed MP1-5236: Added support for nested m3u8 files: made m3u8 parsin…
Browse files Browse the repository at this point in the history
…g a bit more robust
  • Loading branch information
doskabouter committed Mar 9, 2025
1 parent a65aba2 commit 81dcaf9
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 81dcaf9

Please sign in to comment.