mirror of
https://github.com/librespot-org/librespot.git
synced 2026-04-27 08:15:50 +03:00
[GH-ISSUE #294] Implement 'autoplay' functionality #197
Labels
No labels
A-Alsa
SpotifyAPI
Tokio 1.0
audio
bug
can't reproduce
compilation
dependencies
duplicate
enhancement
good first issue
help wanted
high priority
imported
imported
invalid
new api
pull-request
question
reverse engineering
wiki
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/librespot#197
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 @mordax7 on GitHub (Mar 2, 2019).
Original GitHub issue: https://github.com/librespot-org/librespot/issues/294
Sometimes if I let Spotify run for a long time period I come to the end of my playlist, especially if it's really short. Therefore I have in my Spotify Desktop Client the option enabled to play similar songs on the end of the playlist.

I noticed this was not working when using librespot, would it be possible to implement this?
Regards.
@devgianlu commented on GitHub (Mar 2, 2019):
This doesn't seem to be communicated to the player, so it'll have to be an option inside
librespot. I suppose you need to turn off repeat in order for this to work. Right?@mordax7 commented on GitHub (Mar 2, 2019):
Exactly, repeat has to be disabled this to work.
@devgianlu commented on GitHub (Mar 2, 2019):
Stole the idea and implemented it in
librespot-java!@sashahilton00 commented on GitHub (Mar 11, 2019):
@devgianlu was there any reverse engineering required, or are you just pulling the queue again once the local queue ends?
@devgianlu commented on GitHub (Mar 11, 2019):
I am using the
hm://radio-apollo/v3/stations/endpoint to create a station for the given context and they I play it normally.@ashthespy commented on GitHub (Mar 22, 2019):
FWIW: There is an endpoint for this, didn't look into it in detail though.
hm://autoplay-enabled/query@devgianlu commented on GitHub (Mar 23, 2019):
@ashthespy Is there anything more to it? Doing
GET hm://autoplay-enabled/queryreturns400.@ashthespy commented on GitHub (Mar 23, 2019):
@devgianlu Sorry, no I didn't have time to dump more packets and investigate. But it seems to follow the format of
hm://autoplay-enabled/query?uri=spotify%3Auser%3Awhere the uri is of the current playlist.@sashahilton00 commented on GitHub (Mar 23, 2019):
@devgianlu @ashthespy it's pretty simple. You just send a request to the autoplay endpoint as follows:
hm://autoplay-enabled/query?uri=spotify:user:sashahilton00:playlist:5fFTfhV...jqkezuVTYou'll then get a response, which is just a URI to a station for that playlist:
spotify:station:user:sashahilton00:playlist:5fFTfhV...jqkezuVTUse the normal endpoint to get the JSON payload for the station:
hm://radio-apollo/v3/stations/spotify:station:user:sashahilton00:playlist:5fFTfhV...jqkezuVTThen you'll get a JSON payload, which can then just be played like a station normally is. Makes sense that it's a toggle in the client, since the only thing it does is wait for the queue to empty, then makes the above requests and starts playing the radio for the given playlist.
@devgianlu commented on GitHub (Mar 23, 2019):
My implementation is obsolete then. What if autoplay is disabled? Does it still make the request?
@sashahilton00 commented on GitHub (Mar 23, 2019):
Haven't checked, but given it's a client toggle, I imagine if it's disabled it doesn't, and just stops playing once playlist/album is finished
@devgianlu commented on GitHub (Mar 24, 2019):
Anyone tested this? I keep getting
204.@ashthespy commented on GitHub (Mar 24, 2019):
I have the same as @sashahilton00 - the endpoint responds with the station
uriin plain old bytes.@OrestTa commented on GitHub (Oct 19, 2019):
Any status updates on this one? (Such a feature would be amazing indeed!)
One possible workaround is of course to use something like shairport ( https://github.com/mikebrady/shairport-sync ) as, this way, the stream is managed by the user device (phone) and autoplay just works.