diff --git a/m3u/m3u_test.go b/m3u/m3u_test.go index 0db14b0..7a63825 100644 --- a/m3u/m3u_test.go +++ b/m3u/m3u_test.go @@ -80,10 +80,13 @@ func TestParseM3UFromURL(t *testing.T) { testM3UContent := ` #EXTM3U #EXTINF:-1 channelID="x-ID.bcc1" tvg-chno="0.0" tvg-id="bbc1" tvg-name="BBC One" group-title="UK",BBC One +#EXTVLCOPT:http-user-agent=HbbTV/1.6.1 http://example.com/bbc1 #EXTINF:-1 channelID="x-ID.bcc2" tvg-chno="0.0" tvg-id="bbc2" tvg-name="BBC Two" group-title="UK",BBC Two +#EXTVLCOPT:http-user-agent=HbbTV/1.6.1 http://example.com/bbc2 #EXTINF:-1 channelID="x-ID.cnn" tvg-chno="0.0" tvg-id="cnn" tvg-name="CNN International" group-title="News",CNN International +#EXTVLCOPT:http-user-agent=HbbTV/1.6.1 http://example.com/cnn #EXTVLCOPT:logo=http://example.com/bbc_logo.png #EXTINF:-1 channelID="x-ID.fox" tvg-chno="0.0" tvg-name="FOX" group-title="Entertainment",FOX diff --git a/m3u/parser.go b/m3u/parser.go index 1da96d0..4c01eb2 100644 --- a/m3u/parser.go +++ b/m3u/parser.go @@ -197,6 +197,14 @@ func (instance *Parser) ParseURL(m3uURL string, m3uIndex int) error { if strings.HasPrefix(line, "#EXTINF:") { if scanner.Scan() { nextLine := scanner.Text() + // skip all other #EXT tags + for strings.HasPrefix(nextLine, "#") { + if scanner.Scan() { + nextLine = scanner.Text() + } else { + break + } + } if debug { utils.SafeLogf("[DEBUG] Found next line for EXTINF: %s\n", nextLine)