diff --git a/fetch.go b/fetch.go index b720426..08a5ec1 100644 --- a/fetch.go +++ b/fetch.go @@ -18,7 +18,7 @@ import ( "github.com/sunshineplan/useragent" ) -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" +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" func DefaultUserAgent() string { return ua } diff --git a/m3u8.go b/m3u8.go index 23a22aa..568f2cf 100644 --- a/m3u8.go +++ b/m3u8.go @@ -65,11 +65,11 @@ func parse(url *url.URL, playlist m3u8.Playlist) (*url.URL, *m3u8.MediaPlaylist, }) if len(playlist.Variants) != 0 { slog.Debug("Parse from master playlist:\n" + playlist.String()) - u, err := url.Parse(playlist.Variants[0].URI) + ref, err := url.Parse(playlist.Variants[0].URI) if err != nil { return nil, nil, err } - return FetchM3U8MediaPlaylist(u) + return FetchM3U8MediaPlaylist(url.ResolveReference(ref)) } else { return nil, nil, fmt.Errorf("empty master playlist") }