Skip to content

Commit e7ce15d

Browse files
committed
Fix parse MasterPlaylist #116
1 parent 637a891 commit e7ce15d

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

fetch.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import (
1818
"github.com/sunshineplan/useragent"
1919
)
2020

21-
var ua = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36"
21+
var ua = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36"
2222

2323
func DefaultUserAgent() string { return ua }
2424

m3u8.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,11 @@ func parse(url *url.URL, playlist m3u8.Playlist) (*url.URL, *m3u8.MediaPlaylist,
6565
})
6666
if len(playlist.Variants) != 0 {
6767
slog.Debug("Parse from master playlist:\n" + playlist.String())
68-
u, err := url.Parse(playlist.Variants[0].URI)
68+
ref, err := url.Parse(playlist.Variants[0].URI)
6969
if err != nil {
7070
return nil, nil, err
7171
}
72-
return FetchM3U8MediaPlaylist(u)
72+
return FetchM3U8MediaPlaylist(url.ResolveReference(ref))
7373
} else {
7474
return nil, nil, fmt.Errorf("empty master playlist")
7575
}

0 commit comments

Comments
 (0)