[GH-ISSUE #320] [BUG] Not able to fetch lossless format #60

Closed
opened 2026-02-27 08:11:41 +03:00 by kerem · 2 comments
Owner

Originally created by @yeralin on GitHub (Oct 29, 2025).
Original GitHub issue: https://github.com/kokarare1212/librespot-python/issues/320

Describe the bug
Whenever you are trying to fetch AudioQuality.LOSSLESS, it logs:

Using VORBIS format file with VERY_HIGH quality because preferred LOSSLESS quality couldn't be found.

To Reproduce
Steps to reproduce the behavior:

  1. Set quality to AudioQuality.LOSSLESS
  2. Try to fetch the audio file using content_feeder

Expected behavior
Fetches lossless (FLAC) audio format.

Additional context
According to this closed PR (https://github.com/kokarare1212/librespot-python/pull/316) that introduced LOSSLESS support from @akbad:

@Googolplexed0 I tried the same thing and sadly it didn't work properly. I looked into it and my conclusion is that everything in this PR is indeed needed to support FLAC, and it's simply the Spotify endpoints used that aren't serving FLAC files in response to our requests.
My guess is that there's some secret sauce in the Spotify desktop client's requests that we need to replicate somehow here in order to get it to serve us FLAC files. I tried tracing how Spotify's desktop client does it (i.e. using mitmproxy) but didn't have enough time to completely figure it out (and won't for a little while sadly). Whenever this is done, it would probably provide the missing piece to the puzzle.

Originally created by @yeralin on GitHub (Oct 29, 2025). Original GitHub issue: https://github.com/kokarare1212/librespot-python/issues/320 **Describe the bug** Whenever you are trying to fetch `AudioQuality.LOSSLESS`, it logs: ``` Using VORBIS format file with VERY_HIGH quality because preferred LOSSLESS quality couldn't be found. ``` **To Reproduce** Steps to reproduce the behavior: 1. Set quality to `AudioQuality.LOSSLESS` 2. Try to fetch the audio file using `content_feeder` **Expected behavior** Fetches lossless (FLAC) audio format. **Additional context** According to this closed PR (https://github.com/kokarare1212/librespot-python/pull/316) that introduced LOSSLESS support from @akbad: > @Googolplexed0 I tried the same thing and sadly it didn't work properly. I looked into it and my conclusion is that everything in this PR is indeed needed to support FLAC, and it's simply the Spotify endpoints used that aren't serving FLAC files in response to our requests. > My guess is that there's some secret sauce in the Spotify desktop client's requests that we need to replicate somehow here in order to get it to serve us FLAC files. I tried tracing how Spotify's desktop client does it (i.e. using mitmproxy) but didn't have enough time to completely figure it out (and won't for a little while sadly). Whenever this is done, it would probably provide the missing piece to the puzzle.
kerem 2026-02-27 08:11:41 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@DarpNagarsheth commented on GitHub (Nov 15, 2025):

I have a suspicion that Spotify doesn't have that track in FLAC. Is there any way to confirm it's available on their end

<!-- gh-comment-id:3536155756 --> @DarpNagarsheth commented on GitHub (Nov 15, 2025): I have a suspicion that Spotify doesn't have that track in FLAC. Is there any way to confirm it's available on their end
Author
Owner

@yeralin commented on GitHub (Nov 16, 2025):

No, it is related to this issue https://github.com/librespot-org/librespot/issues/1583

It seems like librespot will not pursue trying to work with / fetch lossless format.

<!-- gh-comment-id:3539189310 --> @yeralin commented on GitHub (Nov 16, 2025): No, it is related to this issue https://github.com/librespot-org/librespot/issues/1583 It seems like `librespot` will not pursue trying to work with / fetch lossless format.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/librespot-python-kokarare1212#60
No description provided.