mirror of
https://git.sr.ht/~joren/streamrip-go
synced 2026-06-17 15:05:39 +02:00
fix qobuz interpreter artist urls
This commit is contained in:
@@ -69,6 +69,9 @@ func parseQobuz(raw string, parts []string) *ParsedURL {
|
|||||||
}
|
}
|
||||||
|
|
||||||
mediaType := parts[0]
|
mediaType := parts[0]
|
||||||
|
if mediaType == "interpreter" {
|
||||||
|
mediaType = "artist"
|
||||||
|
}
|
||||||
if !isSupportedMedia(mediaType) {
|
if !isSupportedMedia(mediaType) {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,6 +27,22 @@ func TestQobuzAlbumURL(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestQobuzInterpreterURLParsesAsArtist(t *testing.T) {
|
||||||
|
inputs := []string{
|
||||||
|
"https://www.qobuz.com/us-en/interpreter/odezenne/739874",
|
||||||
|
"https://play.qobuz.com/artist/739874",
|
||||||
|
}
|
||||||
|
for _, input := range inputs {
|
||||||
|
result := Parse(input)
|
||||||
|
if result == nil {
|
||||||
|
t.Fatalf("expected parsed url for %q", input)
|
||||||
|
}
|
||||||
|
if result.Source != "qobuz" || result.MediaType != "artist" || result.ID != "739874" {
|
||||||
|
t.Fatalf("unexpected parse result for %q: %+v", input, result)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func TestTidalTrackURL(t *testing.T) {
|
func TestTidalTrackURL(t *testing.T) {
|
||||||
inputs := []string{
|
inputs := []string{
|
||||||
"https://tidal.com/browse/track/3083287",
|
"https://tidal.com/browse/track/3083287",
|
||||||
|
|||||||
Reference in New Issue
Block a user