mirror of
https://github.com/pierre-emmanuelJ/iptv-proxy.git
synced 2026-03-12 14:13:59 +01:00
Fix m3u url path by escaping it (#18)
Signed-off-by: Pierre-Emmanuel Jacquier <pierre-emmanuel.jacquier@exoscale.ch>
This commit is contained in:
committed by
GitHub
parent
8795338f54
commit
c515ebb741
@@ -13,7 +13,7 @@ func Marshall(p *m3u.Playlist) (string, error) {
|
||||
result := "#EXTM3U\n"
|
||||
for _, track := range p.Tracks {
|
||||
result += "#EXTINF:"
|
||||
result += fmt.Sprintf("%d ", track.Length)
|
||||
result += fmt.Sprintf("%d, ", track.Length)
|
||||
for i := range track.Tags {
|
||||
if i == len(track.Tags)-1 {
|
||||
result += fmt.Sprintf("%s=%q,", track.Tags[i].Name, track.Tags[i].Value)
|
||||
@@ -46,9 +46,9 @@ func ReplaceURL(playlist *m3u.Playlist, user, password string, hostConfig *confi
|
||||
protocol,
|
||||
hostConfig.Hostname,
|
||||
hostConfig.Port,
|
||||
oriURL.Path,
|
||||
user,
|
||||
password,
|
||||
oriURL.EscapedPath(),
|
||||
url.QueryEscape(user),
|
||||
url.QueryEscape(password),
|
||||
)
|
||||
destURL, err := url.Parse(uri)
|
||||
if err != nil {
|
||||
|
||||
@@ -298,9 +298,9 @@ func xtreamReplaceURL(playlist *m3u.Playlist, user, password string, hostConfig
|
||||
protocol,
|
||||
hostConfig.Hostname,
|
||||
hostConfig.Port,
|
||||
user,
|
||||
password,
|
||||
id,
|
||||
url.QueryEscape(user),
|
||||
url.QueryEscape(password),
|
||||
url.QueryEscape(id),
|
||||
)
|
||||
destURL, err := url.Parse(uri)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user