spotify-dl icon indicating copy to clipboard operation
spotify-dl copied to clipboard

Error: Failed to get metadata

Open usainicola opened this issue 6 months ago • 12 comments

I’ve been using the script for weeks and it worked perfectly, thank you!

Unfortunately, the script stopped working after I deactivated and reactivated my Premium account. I deactivated it thinking I could keep using it until the expiration date, just to avoid the automatic renewal. Then I noticed the script had stopped working, so I reactivated it, but now I’m getting the error “Failed to get metadata.”

Is there anything I can do? Maybe a logout/login of the script?

I tried reinstalling it (brew reinstall spotify-dl), but that didn’t solve the issue.

Operating system: macOS Sequoia 15.5 Thanks.

usainicola avatar Aug 08 '25 07:08 usainicola

I am running v 0.9.2, did not cancel my Premium but all of a sudden get:

spotyload ≫ [ 09:46:08 ] ≫ ~ # /root/.cargo/bin/spotify-dl https://open.spotify.com/playlist/[...]
Error: Failed to get metadata

Maybe some Spotify change?

christianreiss avatar Aug 08 '25 07:08 christianreiss

Same issue here.

Phlogi avatar Aug 08 '25 12:08 Phlogi

Hi,

To solve this, use librespot-auth, manually generate a new credentials.json and replace the one spotify-dl generates.

It should work.

madebycm avatar Aug 08 '25 18:08 madebycm

I ran these 3 commands to “reset” spotify-dl:

rm -rf ~/.spotify-dl rm -rf ~/.cache/spotify-dl rm -rf ~/.config/spotify-dl

Then I ran spotify-dl to start the login process, everything was fine up to that point, but the script still returns the error “Failed to get metadata”.

usainicola avatar Aug 08 '25 22:08 usainicola

same issue here trying to download one track :

/tmp $ RUST_BACKTRACE=full spotify-dl "https://open.spotify.com/track/3t3GtCFoABBDACLLSleDgV"
Failed! The B-52s - Planet Claire [00:01:00]

excerpt of log file ~/.spotify-dl/spotify-dl.log :

2025-08-10T11:46:06.402283Z  INFO spotify_dl::track: Parsed URI: Err(Error { kind: InvalidArgument, error: InvalidFormat })
2025-08-10T11:46:06.927620Z  INFO download_track{track=Track { id: SpotifyId("spotify:track:3t3GtCFoABBDACLLSleDgV") } options=DownloadOptions { destination: "/tmp", parallel: 5, format: Flac, force: false }}: spotify_dl::download: Downlo
ading track: "Planet Claire"
2025-08-10T11:46:07.134227Z  INFO spotify_dl::stream::stream: Loading track: SpotifyId("spotify:track:3t3GtCFoABBDACLLSleDgV")
2025-08-10T11:46:07.195323Z  INFO spotify_dl::stream::stream: Track is unavailable: SpotifyId("spotify:track:3t3GtCFoABBDACLLSleDgV")
2025-08-10T11:46:07.195605Z  WARN spotify_dl::stream::stream: Attempt 1 to load track SpotifyId("spotify:track:3t3GtCFoABBDACLLSleDgV") failed: Could not load track: SpotifyId("spotify:track:3t3GtCFoABBDACLLSleDgV")
2025-08-10T11:46:07.195728Z  WARN download_track{track=Track { id: SpotifyId("spotify:track:3t3GtCFoABBDACLLSleDgV") } options=DownloadOptions { destination: "/tmp", parallel: 5, format: Flac, force: false }}: spotify_dl::download: Retryi
ng download, attempt 1 of 3: The B-52s - Planet Claire
2025-08-10T11:46:17.196758Z  INFO spotify_dl::stream::stream: Loading track: SpotifyId("spotify:track:3t3GtCFoABBDACLLSleDgV")
2025-08-10T11:46:17.241174Z  INFO spotify_dl::stream::stream: Track is unavailable: SpotifyId("spotify:track:3t3GtCFoABBDACLLSleDgV")
2025-08-10T11:46:17.241292Z  WARN spotify_dl::stream::stream: Attempt 2 to load track SpotifyId("spotify:track:3t3GtCFoABBDACLLSleDgV") failed: Could not load track: SpotifyId("spotify:track:3t3GtCFoABBDACLLSleDgV")
2025-08-10T11:46:17.241336Z  WARN download_track{track=Track { id: SpotifyId("spotify:track:3t3GtCFoABBDACLLSleDgV") } options=DownloadOptions { destination: "/tmp", parallel: 5, format: Flac, force: false }}: spotify_dl::download: Retryi
ng download, attempt 2 of 3: The B-52s - Planet Claire
2025-08-10T11:46:37.242131Z  INFO spotify_dl::stream::stream: Loading track: SpotifyId("spotify:track:3t3GtCFoABBDACLLSleDgV")
2025-08-10T11:46:37.283732Z  INFO spotify_dl::stream::stream: Track is unavailable: SpotifyId("spotify:track:3t3GtCFoABBDACLLSleDgV")
2025-08-10T11:46:37.283840Z  WARN spotify_dl::stream::stream: Attempt 3 to load track SpotifyId("spotify:track:3t3GtCFoABBDACLLSleDgV") failed: Could not load track: SpotifyId("spotify:track:3t3GtCFoABBDACLLSleDgV")
2025-08-10T11:46:37.283899Z  WARN download_track{track=Track { id: SpotifyId("spotify:track:3t3GtCFoABBDACLLSleDgV") } options=DownloadOptions { destination: "/tmp", parallel: 5, format: Flac, force: false }}: spotify_dl::download: Retryi
ng download, attempt 3 of 3: The B-52s - Planet Claire
2025-08-10T11:47:07.285027Z  INFO spotify_dl::stream::stream: Loading track: SpotifyId("spotify:track:3t3GtCFoABBDACLLSleDgV")
2025-08-10T11:47:07.366502Z  INFO spotify_dl::stream::stream: Track is unavailable: SpotifyId("spotify:track:3t3GtCFoABBDACLLSleDgV")
2025-08-10T11:47:07.366619Z ERROR spotify_dl::stream::stream: Failed to load track: SpotifyId("spotify:track:3t3GtCFoABBDACLLSleDgV"), error: Could not load track: SpotifyId("spotify:track:3t3GtCFoABBDACLLSleDgV")

Stack backtrace:
   0: <unknown>
   1: <unknown>
   2: <unknown>
   3: <unknown>
   4: <unknown>
   5: <unknown>
   6: <unknown>
   7: <unknown>
   8: <unknown>
   9: start_thread
             at ./nptl/pthread_create.c:442:8
  10: __GI___clone3
             at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:81:0
2025-08-10T11:47:07.472884Z ERROR download_track{track=Track { id: SpotifyId("spotify:track:3t3GtCFoABBDACLLSleDgV") } options=DownloadOptions { destination: "/tmp", parallel: 5, format: Flac, force: false }}: spotify_dl::download: Error
while streaming track: LoadError("Failed to load track: SpotifyId(\"spotify:track:3t3GtCFoABBDACLLSleDgV\")")
2025-08-10T11:47:07.472937Z ERROR download_track{track=Track { id: SpotifyId("spotify:track:3t3GtCFoABBDACLLSleDgV") } options=DownloadOptions { destination: "/tmp", parallel: 5, format: Flac, force: false }}: spotify_dl::download: Failed
 to download The B-52s - Planet Claire: Streaming error: LoadError("Failed to load track: SpotifyId(\"spotify:track:3t3GtCFoABBDACLLSleDgV\")")
2025-08-10T11:47:07.473141Z  WARN spotify_dl::stream::stream: Attempt 3 to load track SpotifyId("spotify:track:3t3GtCFoABBDACLLSleDgV") failed: Could not load track: SpotifyId("spotify:track:3t3GtCFoABBDACLLSleDgV")

loloster avatar Aug 10 '25 11:08 loloster

trying to download a full album :

/tmp $ RUST_BACKTRACE=full spotify-dl "https://open.spotify.com/album/7o574v0OnkUUdHYiUKzixD"

thread 'main' panicked at src/track.rs:161:14:
Failed to get album: Error { kind: Unavailable, error: StatusCode(500) }
stack backtrace:
   0:     0x56103e45fc12 - <unknown>
   1:     0x56103e048c93 - <unknown>
   2:     0x56103e45f5ef - <unknown>
   3:     0x56103e45fa73 - <unknown>
   4:     0x56103e45f0ed - <unknown>
   5:     0x56103e493b28 - <unknown>
   6:     0x56103e493a89 - <unknown>
   7:     0x56103e49476c - <unknown>
   8:     0x56103e04742f - <unknown>
   9:     0x56103e04e005 - <unknown>
  10:     0x56103e3eae3f - <unknown>
  11:     0x56103e42204d - <unknown>
  12:     0x56103e41081a - <unknown>
  13:     0x56103e45a851 - <unknown>
  14:     0x56103e445a2c - <unknown>
  15:     0x56103e45a285 - <unknown>
  16:     0x7f7b9c8f2d90 - __libc_start_call_main
                               at ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16
  17:     0x7f7b9c8f2e40 - __libc_start_main_impl
                               at ./csu/../csu/libc-start.c:392:3
  18:     0x56103dfc0da5 - <unknown>
  19:                0x0 - <unknown>

logfile : 2025-08-10T11:52:44.675054Z INFO spotify_dl::track: Parsed URI: Err(Error { kind: InvalidArgument, error: InvalidFormat })

loloster avatar Aug 10 '25 11:08 loloster

download album with the spotify URI :

/tmp $ RUST_BACKTRACE=full spotify-dl spotify:album:4VcKXOCUzcrxltYt0Jyqfk
Error: Failed to get metadata

Stack backtrace:
   0: <unknown>
   1: <unknown>
   2: <unknown>
   3: <unknown>
   4: <unknown>
   5: <unknown>
   6: <unknown>
   7: <unknown>
   8: __libc_start_call_main
             at ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16
   9: __libc_start_main_impl
             at ./csu/../csu/libc-start.c:392:3
  10: <unknown>

logfile :

2025-08-10T14:39:04.883870Z  INFO spotify_dl::track: Parsed URI: Ok(SpotifyId("spotify:album:4VcKXOCUzcrxltYt0Jyqfk"))
2025-08-10T14:39:05.452785Z  INFO download_track{track=Track { id: SpotifyId("spotify:track:5t0vvOox2t9W0WmVH8zb1o") } options=DownloadOptions { destination: "/tmp", parallel: 5, format: Flac, force: false }}: spotify_dl::download: Downlo
ading track: "52 Girls"
2025-08-10T14:39:05.454832Z  INFO download_track{track=Track { id: SpotifyId("spotify:track:3t3GtCFoABBDACLLSleDgV") } options=DownloadOptions { destination: "/tmp", parallel: 5, format: Flac, force: false }}: spotify_dl::download: Downlo
ading track: "Planet Claire"
2025-08-10T14:39:05.477568Z  INFO download_track{track=Track { id: SpotifyId("spotify:track:0rme3FLbw5o1KLXpJzivjS") } options=DownloadOptions { destination: "/tmp", parallel: 5, format: Flac, force: false }}: spotify_dl::download: Downlo
ading track: "Rock Lobster"
2025-08-10T14:39:05.975506Z  INFO spotify_dl::stream::stream: Loading track: SpotifyId("spotify:track:5t0vvOox2t9W0WmVH8zb1o")
2025-08-10T14:39:05.985683Z  INFO spotify_dl::stream::stream: Loading track: SpotifyId("spotify:track:3t3GtCFoABBDACLLSleDgV")
2025-08-10T14:39:06.033923Z  INFO spotify_dl::stream::stream: Loading track: SpotifyId("spotify:track:0rme3FLbw5o1KLXpJzivjS")
2025-08-10T14:39:06.056554Z  INFO spotify_dl::stream::stream: Track is unavailable: SpotifyId("spotify:track:3t3GtCFoABBDACLLSleDgV")
2025-08-10T14:39:06.056733Z  WARN spotify_dl::stream::stream: Attempt 1 to load track SpotifyId("spotify:track:3t3GtCFoABBDACLLSleDgV") failed: Could not load track: SpotifyId("spotify:track:3t3GtCFoABBDACLLSleDgV")
2025-08-10T14:39:06.056818Z  WARN download_track{track=Track { id: SpotifyId("spotify:track:3t3GtCFoABBDACLLSleDgV") } options=DownloadOptions { destination: "/tmp", parallel: 5, format: Flac, force: false }}: spotify_dl::download: Retryi
ng download, attempt 1 of 3: The B-52s - Planet Claire
2025-08-10T14:39:06.063919Z  INFO spotify_dl::stream::stream: Track is unavailable: SpotifyId("spotify:track:5t0vvOox2t9W0WmVH8zb1o")
2025-08-10T14:39:06.064020Z  WARN spotify_dl::stream::stream: Attempt 1 to load track SpotifyId("spotify:track:5t0vvOox2t9W0WmVH8zb1o") failed: Could not load track: SpotifyId("spotify:track:5t0vvOox2t9W0WmVH8zb1o")
2025-08-10T14:39:06.064059Z  WARN download_track{track=Track { id: SpotifyId("spotify:track:5t0vvOox2t9W0WmVH8zb1o") } options=DownloadOptions { destination: "/tmp", parallel: 5, format: Flac, force: false }}: spotify_dl::download: Retryi
ng download, attempt 1 of 3: The B-52s - 52 Girls
2025-08-10T14:39:06.086534Z  INFO spotify_dl::stream::stream: Track is unavailable: SpotifyId("spotify:track:0rme3FLbw5o1KLXpJzivjS")
2025-08-10T14:39:06.086650Z  WARN spotify_dl::stream::stream: Attempt 1 to load track SpotifyId("spotify:track:0rme3FLbw5o1KLXpJzivjS") failed: Could not load track: SpotifyId("spotify:track:0rme3FLbw5o1KLXpJzivjS")
2025-08-10T14:39:06.086694Z  WARN download_track{track=Track { id: SpotifyId("spotify:track:0rme3FLbw5o1KLXpJzivjS") } options=DownloadOptions { destination: "/tmp", parallel: 5, format: Flac, force: false }}: spotify_dl::download: Retryi
ng download, attempt 1 of 3: The B-52s - Rock Lobster

loloster avatar Aug 10 '25 14:08 loloster

Same issue here. A few days ago it was working. Probably a change in Spotify's end.

diegorad avatar Aug 12 '25 11:08 diegorad

It is indeed an issue related to recent changes on Spotify's end. It is fixed in librespot but they haven't made a release yet.

See: https://github.com/librespot-org/librespot/pull/1528

One can build their own version of spotify-dl by using a recent version of librespot from git.

If wanted, I can create a PR for the temporary fix.

brainslush avatar Aug 14 '25 18:08 brainslush

Solved here with @brainslush's PR

loloster avatar Aug 15 '25 14:08 loloster

Hi, seems that librespot released a new version a few days ago and the change doesn't work anymore. Also installing the app as it is now returns failed to get artist and not medatata anymore

franzqat avatar Aug 28 '25 16:08 franzqat

Edit Cargo.toml and update librespot line to

librespot = { version = "0.7.1", default-features = false, features = ["rustls-tls-webpki-roots"] }

efpob avatar Aug 31 '25 19:08 efpob