fix: switch CDN audio resolution from api.spotify.com to spclient#722
Open
grenaad wants to merge 1 commit intojpochyla:mainfrom
Open
fix: switch CDN audio resolution from api.spotify.com to spclient#722grenaad wants to merge 1 commit intojpochyla:mainfrom
grenaad wants to merge 1 commit intojpochyla:mainfrom
Conversation
Resolves audio file URLs via spclient (storage-resolve protobuf endpoint) instead of the rate-limited api.spotify.com JSON endpoint. This matches librespot's approach and avoids 429 rate-limiting on playback. - Add Transport::resolve_spclient() for AP resolver spclient discovery - Parse StorageResolveResponse protobuf instead of JSON - Send client-token header required by spclient - Share ClientTokenProvider (via Arc) between Cdn and Login5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Disclosure
All code is generated with Opencode with Opus model. I tested this with my own client id, and auth is working. I have not used Rust in a few years, so I can't verify that the code quality is up to standard. I am happy to make any changes requested.
Summary
Spotify started returning 429 (Too Many Requests) for requests to
api.spotify.com/v1/storage-resolve. This switches audio file URL resolution to Spotify'sspclientinfrastructure, matching librespot's approach.Inspired by ncspot commit 6769b7b. Split from #720 per review feedback — Web API Client ID changes will follow in a subsequent PR.
Changes
Transport::resolve_spclient()to discover spclient access points viaapresolve.spotify.com/?type=spclientCdn::resolve_audio_file_url()now useshttps://{spclient}/storage-resolve/...instead ofapi.spotify.com/v1/storage-resolveStorageResolveResponseinstead of JSONclient-tokenheader required by spclient endpointArc<ClientTokenProvider>betweenLogin5andCdnto avoid redundant round-tripsCdninstance lifetime