fix m3u forkplayer bug in link

This commit is contained in:
YouROK
2021-01-14 16:04:02 +03:00
parent 98c7982d25
commit 526b37b2e4
2 changed files with 3 additions and 2 deletions

View File

@@ -25,9 +25,10 @@ func allPlayList(c *gin.Context) {
host := "http://" + c.Request.Host
list := "#EXTM3U\n"
hash := ""
// fn=file.m3u fix forkplayer bug with end .m3u in link
for _, tr := range torrs {
list += "#EXTINF:0 type=\"playlist\"," + tr.Title + "\n"
list += host + "/stream/" + url.PathEscape(tr.Title) + ".m3u?link=" + tr.TorrentSpec.InfoHash.HexString() + "&m3u\n"
list += host + "/stream/" + url.PathEscape(tr.Title) + ".m3u?link=" + tr.TorrentSpec.InfoHash.HexString() + "&m3u&fn=file.m3u\n"
hash += tr.Hash().HexString()
}

View File

@@ -102,7 +102,7 @@ func stream(c *gin.Context) {
// return m3u if query
if m3u {
m3ulist := "#EXTM3U\n" + getM3uList(tor.Status(), "http://"+c.Request.Host, fromlast)
sendM3U(c, tor.Name(), tor.Hash().HexString(), m3ulist)
sendM3U(c, tor.Name()+".m3u", tor.Hash().HexString(), m3ulist)
return
} else
// return play if query