mirror of
https://github.com/Ernous/TorrServerJellyfin.git
synced 2025-12-19 13:36:09 +05:00
add m3u8 check in fname
and handle missing fname in streamNoAuth also
This commit is contained in:
@@ -124,7 +124,7 @@ func stream(c *gin.Context) {
|
||||
name := strings.ReplaceAll(c.Param("fname"), `/`, "") // strip starting / from param
|
||||
if name == "" {
|
||||
name = tor.Name() + ".m3u"
|
||||
} else if !strings.HasSuffix(strings.ToLower(name), ".m3u") {
|
||||
} else if !strings.HasSuffix(strings.ToLower(name), ".m3u") && !strings.HasSuffix(strings.ToLower(name), ".m3u8") {
|
||||
name += ".m3u"
|
||||
}
|
||||
m3ulist := "#EXTM3U\n" + getM3uList(tor.Status(), utils2.GetScheme(c)+"://"+c.Request.Host, fromlast)
|
||||
@@ -207,8 +207,14 @@ func streamNoAuth(c *gin.Context) {
|
||||
|
||||
// return m3u if query
|
||||
if m3u {
|
||||
name := strings.ReplaceAll(c.Param("fname"), `/`, "") // strip starting / from param
|
||||
if name == "" {
|
||||
name = tor.Name() + ".m3u"
|
||||
} else if !strings.HasSuffix(strings.ToLower(name), ".m3u") && !strings.HasSuffix(strings.ToLower(name), ".m3u8") {
|
||||
name += ".m3u"
|
||||
}
|
||||
m3ulist := "#EXTM3U\n" + getM3uList(tor.Status(), utils2.GetScheme(c)+"://"+c.Request.Host, fromlast)
|
||||
sendM3U(c, tor.Name()+".m3u", tor.Hash().HexString(), m3ulist)
|
||||
sendM3U(c, name, tor.Hash().HexString(), m3ulist)
|
||||
return
|
||||
} else
|
||||
// return play if query
|
||||
|
||||
Reference in New Issue
Block a user