librespot: Can't play short files: "Unable to load encrypted file"

If you try to play a short file (not sure of the exact length, but seems like under 30 seconds), playback fails:

TRACE librespot_connect::spirc] Sending status to server: [kPlayStatusPlay]
DEBUG librespot_playback::player] command=Load(SpotifyId { id: 301932663658771966891455576440240138600, audio_type: Track }, true, 0)
TRACE librespot_connect::spirc] Sending status to server: [kPlayStatusPlay]
INFO  librespot_playback::player] Loading <Her Majesty - Remastered 2009> with Spotify URI <spotify:track:6UCFZ9ZOFRxK8oak7MdPZu>
DEBUG librespot_audio::fetch] Downloading file 6dba450723dfdf967aa3740beeca4d73adde7bca
ERROR librespot_core::channel] channel error: 2 0
ERROR librespot_playback::player] Unable to load encrypted file.
WARN  librespot_playback::player] Unable to load <SpotifyId { id: 301932663658771966891455576440240138600, audio_type: Track }>
Skipping to next track
DEBUG librespot_connect::spirc] At track 6 of 7 <"spotify:playlist:3NebgOp0IPF6BBAa4QynYy"> update [true]
TRACE librespot_connect::spirc] Sending status to server: [kPlayStatusPlay]
DEBUG librespot_playback::player] command=Load(SpotifyId { id: 266252029018687294844893778780865354245, audio_type: Track }, true, 0)
TRACE librespot_connect::spirc] Sending status to server: [kPlayStatusPlay]
INFO  librespot_playback::player] Loading <Yeah - Remastered 2011> with Spotify URI <spotify:track:65YeIE3Y4YBNLnXcpVZz1P>
DEBUG librespot_audio::fetch] Downloading file f284aab8b539754b5c6c04eaa182a95d2258ad93
ERROR librespot_core::channel] channel error: 2 0
ERROR librespot_playback::player] Unable to load encrypted file.
WARN  librespot_playback::player] Unable to load <SpotifyId { id: 266252029018687294844893778780865354245, audio_type: Track }>
Skipping to next track
DEBUG librespot_connect::spirc] At track 7 of 7 <"spotify:playlist:3NebgOp0IPF6BBAa4QynYy"> update [true]
TRACE librespot_connect::spirc] Sending status to server: [kPlayStatusPause]

Songs of 40 seconds or longer on the same albums seem to load and play fine, and the failing short songs also play fine through the web browser client.

Here is a sample playlist with only songs that fail in librespot.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 3
  • Comments: 17 (11 by maintainers)

Most upvoted comments

I’ve seen similar reports where people claim that this was a recent change in behaviour (not librespot release related). As if something on Spotify’s end had changed, causing this.

They also say that the threshold for the track length depends on the bitrate used. Eg. at 96kbps you’d need at least 1:30 to play successfully (https://forums.slimdevices.com/showthread.php?112638-Spotty-Crashing-Help&p=982803&viewfull=1#post982803)

I’m going to close this issue as well as it seems there are no further problems playing short songs. Spotify seem to have rectified the problem at their end. The other issue causing problems playing longer songs is covered in #519 which is also resolved now as well.