add m3u8 check in fname

and handle missing fname in streamNoAuth also
This commit is contained in:
nikk gitanes
2023-10-31 02:33:46 +03:00
parent c1e3b64426
commit 1e7228550b
2 changed files with 9 additions and 3 deletions

View File

@@ -69,7 +69,7 @@ func playList(c *gin.Context) {
name := strings.ReplaceAll(c.Param("fname"), `/`, "") // strip starting / from param
if name == "" {
name = tor.Name() + ".m3u"
} else {
} else if !strings.HasSuffix(strings.ToLower(name), ".m3u") && !strings.HasSuffix(strings.ToLower(name), ".m3u8") {
name += ".m3u"
}