mirror of
https://git.sr.ht/~joren/streamrip-go
synced 2026-06-17 15:05:39 +02:00
harden qobuz and downloader reliability edge cases
This commit is contained in:
@@ -146,7 +146,7 @@ func (c *Client) searchPlaylists(ctx context.Context, query string, limit int) (
|
||||
return nil, err
|
||||
}
|
||||
|
||||
re := regexp.MustCompile(`/[A-Za-z0-9_-]+/sets/[A-Za-z0-9_-]+`)
|
||||
re := regexp.MustCompile(`/(?:[A-Za-z0-9._-]+)/sets/(?:[A-Za-z0-9._%~-]+)`)
|
||||
paths := re.FindAllString(string(body), -1)
|
||||
if len(paths) == 0 {
|
||||
return []map[string]any{}, nil
|
||||
@@ -435,10 +435,11 @@ func canonicalSoundcloudURL(info map[string]any) string {
|
||||
continue
|
||||
}
|
||||
host := strings.ToLower(strings.TrimPrefix(u.Host, "www."))
|
||||
if host != "soundcloud.com" {
|
||||
if host != "soundcloud.com" && !strings.HasSuffix(host, ".soundcloud.com") {
|
||||
continue
|
||||
}
|
||||
u.Scheme = "https"
|
||||
u.Host = "soundcloud.com"
|
||||
u.RawQuery = ""
|
||||
u.Fragment = ""
|
||||
u.Path = strings.TrimSuffix(u.Path, "/")
|
||||
|
||||
Reference in New Issue
Block a user