mirror of
https://github.com/devgianlu/go-librespot.git
synced 2026-04-25 21:05:47 +03:00
[GH-ISSUE #287] feat: add support for DJ mode #173
Labels
No labels
bug
enhancement
pull-request
spotify-side
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/go-librespot#173
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @hkcryos on GitHub (Jan 28, 2026).
Original GitHub issue: https://github.com/devgianlu/go-librespot/issues/287
Spotify's AI DJ mode uses a special context type (
lexicon_set_type: your_dj) that doesn't work with the standard context resolution. The current implementation fails because:urifield inContextTrack- the actual URI is inmetadata["canonical_track_uri"]I've got this working locally and am enjoying it now. My implementation does it like this:
ContextTrackUri()helper that falls back tocanonical_track_urimetadataTransferState.Playback.CurrentTrackfor DJ transfersNextTracksfromClusterUpdatemessages (the service broadcasts the full queue before transfer)I haven't looked at the TTS DJ-speak between tracks (I don't like that!) or the cross-fading between tracks (again, I dislike it, so didn't implement it).
Happy to commit a branch if there's interest in supporting this.
@fegauthier commented on GitHub (Jan 28, 2026):
Would be great to support that!
Thanks!
@devgianlu commented on GitHub (Jan 29, 2026):
Hi @hkcryos and thank you for the interest in the project! Unfortunately DJ X is not available in my country so I woudn't be able to test and merge your code straightaway without the help of someone else.
Additionally, getting the tracks from
ClusterUpdatemessages doesn't seem like the best strategy, the client should be able to pull the track list from somewhere if it's not in the context transfer already.From the related librespot issue I can see that
lexicon_context_urlis provided in the context metadata. The URL starts withhm://, but that usually means that it can be transformed in a HTTP API by stripping the prefix. We already do that here.If you think you can get this working I think it'll be a pretty nice addition, even without TTS or crossfade.
@hkcryos commented on GitHub (Jan 30, 2026):
Thanks @devgianlu - as you say, that's really unfortunate.
I entirely agree about lexicon_context_url. I should've said - I tried that approach initially but when you follow it, you get a 404.
Looking at the behaviour from the web player (which seems to be the same for the Windows client):
The app never calls the lexicon URL - it appears in Pathfinder response metadata but no HTTP request is ever made to it
Pathfinder returns 0 tracks for the DJ playlist (content.items: [], totalCount: 0)
Track list comes from dealer WebSocket - ClusterUpdate messages contain NextTracks with the full queue
The ClusterUpdate caching approach appears to be how the apps work too, which feels odd to me given we have the lexicon - but that is what I saw.
Happy to dig further if it would help? Or we could see if others could confirm it isn't just me?
@devgianlu commented on GitHub (Feb 1, 2026):
@hkcryos I would try seeing what the desktop client does, you can intercept HTTPS requests with something like mitmproxy.