also for stream

This commit is contained in:
nikk gitanes
2023-10-13 17:38:41 +03:00
parent 0d413b2917
commit 64ae3b8f1c
2 changed files with 9 additions and 2 deletions

View File

@@ -42,7 +42,6 @@ func allPlayList(c *gin.Context) {
// http://127.0.0.1:8090/playlist?hash=...&fromlast
// http://127.0.0.1:8090/playlist/fname?hash=...
func playList(c *gin.Context) {
name := strings.ReplaceAll(c.Param("fname"), `/`, "") // strip starting / from param
hash, _ := c.GetQuery("hash")
_, fromlast := c.GetQuery("fromlast")
if hash == "" {
@@ -67,6 +66,7 @@ func playList(c *gin.Context) {
host := utils.GetScheme(c) + "://" + c.Request.Host
list := getM3uList(tor.Status(), host, fromlast)
list = "#EXTM3U\n" + list
name := strings.ReplaceAll(c.Param("fname"), `/`, "") // strip starting / from param
if name == "" {
name = tor.Name() + ".m3u"
} else {