Add default OS tmp dir

Signed-off-by: Pierre-Emmanuel Jacquier <15922119+pierre-emmanuelJ@users.noreply.github.com>
This commit is contained in:
Pierre-Emmanuel Jacquier
2021-03-18 22:25:34 +01:00
parent a763cdaadf
commit 08bbf139c5
2 changed files with 3 additions and 2 deletions

View File

@@ -25,6 +25,7 @@ import (
"net/url"
"os"
"path"
"path/filepath"
"strings"
"github.com/jamesnetherton/m3u"
@@ -35,7 +36,7 @@ import (
"github.com/gin-gonic/gin"
)
var defaultProxyfiedM3UPath = "/tmp/" + uuid.NewV4().String() + ".iptv-proxy.m3u"
var defaultProxyfiedM3UPath = filepath.Join(os.TempDir(), uuid.NewV4().String()+".iptv-proxy.m3u")
// Config represent the server configuration
type Config struct {

View File

@@ -62,7 +62,7 @@ func (c *Config) cacheXtreamM3u(m3uURL *url.URL) error {
tmp := *c
tmp.playlist = &playlist
path := filepath.Join("/tmp", uuid.NewV4().String()+".iptv-proxy")
path := filepath.Join(os.TempDir(), uuid.NewV4().String()+".iptv-proxy.m3u")
f, err := os.Create(path)
if err != nil {
return err