From d71543935b24a39624813be9f7f87cc1580f8923 Mon Sep 17 00:00:00 2001 From: Jaeseok Lee Date: Wed, 24 Jul 2024 14:10:27 +0900 Subject: [PATCH] Fix append args if media playlist already has query params --- writer.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/writer.go b/writer.go index 0e32ea3a..f03fa64c 100644 --- a/writer.go +++ b/writer.go @@ -700,7 +700,11 @@ func (p *MediaPlaylist) Encode() *bytes.Buffer { p.buf.WriteRune('\n') p.buf.WriteString(seg.URI) if p.Args != "" { - p.buf.WriteRune('?') + if strings.Contains(seg.URI, "?") { + p.buf.WriteRune('&') + } else { + p.buf.WriteRune('?') + } p.buf.WriteString(p.Args) } p.buf.WriteRune('\n')