feat yandex desktop downloads

This commit is contained in:
2026-06-10 12:58:04 +02:00
parent fa39582849
commit 0ae8c7e008
15 changed files with 1543 additions and 8 deletions

View File

@@ -27,6 +27,30 @@ func TestQobuzAlbumURL(t *testing.T) {
}
}
func TestYandexURLs(t *testing.T) {
tests := []struct {
url string
mediaType string
id string
}{
{url: "https://music.yandex.ru/track/9442712", mediaType: "track", id: "9442712"},
{url: "https://music.yandex.ru/album/1000856", mediaType: "album", id: "1000856"},
{url: "https://music.yandex.ru/album/1000856/track/9442712", mediaType: "track", id: "9442712:1000856"},
{url: "https://music.yandex.ru/artist/1433871", mediaType: "artist", id: "1433871"},
{url: "https://music.yandex.ru/users/yandexmusic/playlists/1635", mediaType: "playlist", id: "yandexmusic:1635"},
{url: "https://music.yandex.ru/playlists/4ae45ac1-0972-734f-8537-769490399170", mediaType: "playlist", id: "4ae45ac1-0972-734f-8537-769490399170"},
}
for _, tc := range tests {
result := Parse(tc.url)
if result == nil {
t.Fatalf("expected parse for %q", tc.url)
}
if result.Source != "yandex" || result.MediaType != tc.mediaType || result.ID != tc.id {
t.Fatalf("unexpected parse result for %q: %+v", tc.url, result)
}
}
}
func TestTidalTrackURL(t *testing.T) {
inputs := []string{
"https://tidal.com/browse/track/3083287",