session_bus = dbus.SessionBus()
spotify_bus = session_bus.get_object("org.mpris.MediaPlayer2.spotify",
spotify_properties = dbus.Interface(spotify_bus,
metadata = spotify_properties.Get("org.mpris.MediaPlayer2.Player", "Metadata")
# The property Metadata behaves like a python dict
for key, value in metadata.items():
print key, value
# To just print the title
wish of those help To get notified when playing state has changed (which tells you the new track), you watch for a distributed notification called "com.spotify.client.PlaybackStateChanged". There are at least two other questions here asking how to do that, one of which has sample code, so try searching for that. (Or just fire up Notification Watcher and you can see them for yourself, and it should be easy to figure out how to write the code to handle them.) If you want to check the current track manually (e.g., at startup), you can use the Spotify AppleScript interface (which of course you can also access via ScriptingBridge, appscript, etc.), like this:
tell application "Spotify"
name of current track
Initiate Spotify track playback at a given start time using the iOS Spotify SDK?
Any of those help We're using the iOS Spotify sdk to play Spotify tracks via SPTAudioStreamingController. I'm playing a track via playURIs:fromIndex:callback but the goal is to play it back starting from a given time offset (vs the start of the track). , You need to call
fixed the issue. Will look into that further You can get a 403 when trying to playback without having premium but the message would say PREMIUM_REQUIRED, another possibility is that the parameters for Seek aren't correct, only position_ms and device_id are supported, with the latter being option, you could try checking what's being sent to Spotify to check the request to https://api.spotify.com/v1/me/player/seek is correct
How can I control spotify music from a different app and pull information such as playlist and track currently playing?