Type in your question below and we'll check to see what answers we can find...
Loading article...
Submitting...
If you couldn't find any answers in the previous step then we need to post your question in the community and wait for someone to respond. You'll be notified when that happens.
Simply add some detail to your question and refine the title if needed, choose the relevant category, then post.
Before we can post your question we need you to quickly make an account (or sign in if you already have one).
Don't worry - it's quick and painless! Just click below, and once you're logged in we'll bring you right back here and post your question. We'll remember what you've already typed in so you won't have to do it again.
Hi:
I am using spotify1.0.17.75.g8f111100 on Arch Linux. Whenever I try to play an album via DBus, for instance
dbus-send --print-reply --session --type=method_call --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.OpenUri "string:spotify:album:4sb0eMpDn3upAFfyi4q2rw"
It correctly opens the album, but does not start playing it. I remember a previous version of the linux client supported this, is it a regression?
Solved! Go to Solution.
Hey @pschorf,
Sorry, I was unable to test the script at first place. ๐
Here is a workaround using the deprecated
uri=spotify:album:4sb0eMpDn3upAFfyi4q2rw # We are going to use this variable to access the metadata for the album. song=$(curl -G "http://ws.spotify.com/lookup/1/?uri=$uri&extras=track" | grep -E -o "spotify:track:[a-zA-Z0-9]+" -m 1) # Get the first track of the Album. We are going to use this variable in next line. dbus-send --print-reply --session --type=method_call --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Pause && dbus-send --print-reply --session --type=method_call --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.OpenUri "string:$song" # Pause the player and the play the first song of the album
For long term, you can check the Web API and update the curl line.
Hope this help ๐
Hey @pschorf and welcome to Spotify Community,
I am not sure what happened with the autoplay option, but you can execute PlayPause option right after and it will act the same:
dbus-send --print-reply --session --type=method_call --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.OpenUri "string:spotify:album:4sb0eMpDn3upAFfyi4q2rw" && dbus-send --print-reply --session --type=method_call --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause
That actually plays/pauses whatever I had open before, not the new content.
Hey @pschorf,
Sorry, I was unable to test the script at first place. ๐
Here is a workaround using the deprecated
uri=spotify:album:4sb0eMpDn3upAFfyi4q2rw # We are going to use this variable to access the metadata for the album. song=$(curl -G "http://ws.spotify.com/lookup/1/?uri=$uri&extras=track" | grep -E -o "spotify:track:[a-zA-Z0-9]+" -m 1) # Get the first track of the Album. We are going to use this variable in next line. dbus-send --print-reply --session --type=method_call --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Pause && dbus-send --print-reply --session --type=method_call --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.OpenUri "string:$song" # Pause the player and the play the first song of the album
For long term, you can check the Web API and update the curl line.
Hope this help ๐
That works! Sorry, I was away from my linux machine for a bit so I couldn't confirm. Thanks very much.
Hey there you, ย Yeah, you!ย 😁 ย Welcome - we're glad you joined the Spotify Community! ย While you here, let's have a fun game and getโฆ