-
-
Notifications
You must be signed in to change notification settings - Fork 327
Proposal: Fetch Lower Qualities when Desired Quality for Track not Found #879
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
Example taken from the ☝️ linked issue.
Quality is 2 (FLAC) but the track does not seem to be available in FLAC (see Maybe there is some aspect of the deezer API, cdn strategy, or some other context I am unaware of that would be able to access the FLAC correctly. Because I don't really know anything about Deezer, this was the first solution that came to mind. Either way, while I would prefer to have FLAC files for everything I would rather mix in some 320 MP3s than be high and dry entirely. |
If anyone wants to run this fix in unraid, you can use the following config Add the path maps
if you want to host it on your account, this is the dockerfile i used
Then you can just open a new console and run |
@nathom take a look when you get a chance. |
After using this for a few days, a more useful setting for me would be closer to |
I have updated the branch with the new approach that just gets the next best quality. I was still finding some tracks that were only in low res mp3. |
How thoroughly have you tested this? |
I have been using a different version of this on my forked repo to great success. I can re-test this exact code and make sure to fix the failing tests (sorry about that). |
Fixed the tests btw so should be good to merge. |
Add fallback quality support for Deezer downloads
Problem
When requesting a specific audio quality (e.g., FLAC) from Deezer, the download fails if that quality isn't available, even if lower qualities are accessible.
Solution
Add a
lower_quality_if_not_available
configuration option to DeezerConfig that automatically falls back to an alternative quality when the requested quality is unavailable.Changes
lower_quality_if_not_available
field toDeezerConfig
dataclassDeezerClient.get_downloadable()
methodImplementation Details
The fallback logic checks if the requested quality has a file size of 0 (unavailable) and if lesser qualities are available. If so, it automatically switches to the next best quality and logs a warning.
Configuration
Testing
Notes
This is a proposal for handling unavailable track qualities. The author may prefer a different approach or implementation strategy. At the very least this should get the ball rolling on a problem that was driving me nuts.