fixup! fixup! fixup! Add xtream /get.php

Signed-off-by: Pierre-Emmanuel Jacquier <pierre-emmanuel.jacquier@epitech.eu>
This commit is contained in:
Pierre-Emmanuel Jacquier
2019-08-28 17:27:08 +00:00
parent 23738e32b3
commit f634513dc8

View File

@@ -6,6 +6,7 @@ import (
"log"
"net/http"
"net/url"
"strings"
"time"
"github.com/gin-gonic/gin"
@@ -15,7 +16,7 @@ import (
)
func (p *proxy) xtreamGet(c *gin.Context) {
rawURL := fmt.Sprintf("%s/get.php?username=%s&password%s", p.XtreamBaseURL, p.XtreamUser, p.XtreamPassword)
rawURL := fmt.Sprintf("%s/get.php?username=%s&password=%s", p.XtreamBaseURL, p.XtreamUser, p.XtreamPassword)
q := c.Request.URL.Query()
@@ -24,7 +25,7 @@ func (p *proxy) xtreamGet(c *gin.Context) {
continue
}
rawURL = fmt.Sprintf("%s&%s=%s", rawURL, k, v)
rawURL = fmt.Sprintf("%s&%s=%s", rawURL, k, strings.Join(v, ","))
}
m3uURL, err := url.Parse(rawURL)
@@ -33,8 +34,6 @@ func (p *proxy) xtreamGet(c *gin.Context) {
return
}
println("debug:", m3uURL.String())
playlist, err := m3u.Parse(m3uURL.String())
if err != nil {
c.AbortWithError(http.StatusInternalServerError, err)