Apple OSA script not returning playback information for new songs

Reply
Highlighted

Apple OSA script not returning playback information for new songs

Regular

Plan

Premium

Country

Sweden

Device

Macbook Pro 2019

Operating System

OSX Catalina 10.15.3 (19D76)

 

My Question or Issue

I have an applet in my console that automatically adds the current playing track as well as music controls to my tmux-powerline like this:
example.png

 

For that I'm using the following OSA script:

Screenshot 2020-04-28 at 12.44.34.png
A few days ago however Spotify stopped showing a lot of details in the "current track" object. Here is a screenshot of the entire object:
Screenshot 2020-04-28 at 12.46.33.png

At this point more and more tracks are starting to loose track-information through the OSA api. Did something update on your or my side and should I edit my scripts or is this a bug on your side?

Example track-id's with missing information:
spotify:track:4RDBBKJRu4c11BnGsA89Bh
spotify:track:1gmj9SGmFea50SyyVYgFkP

Restarting Spotify does not seem to fix this issue. might re-install just in case

19 Replies
Highlighted

Re: Apple OSA script not returning playback information for new songs

Regular

I need to add here that This also affects the spotify plugin published by your team:
https://formulae.brew.sh/cask/spotify

as seen in this screen-shot:

HendrikPetertje_0-1588071504547.png

 

Highlighted

Re: Apple OSA script not returning playback information for new songs

Spotify
Spotify

Thanks for reporting this, @HendrikPetertje! I'll look into it further on our side. Do you remember when you first noticed this problem?

Highlighted

Re: Apple OSA script not returning playback information for new songs

Regular

My spotify installation was last updated on the 21st of April.
I started noticing this on Friday the 24th.
A reinstall of the application doesn't seem to fix the issue (drag spotify to bin, empty bin, download spotify again and run install).

That said and problems aside; I absolutely love the fact that you folks built OSA & DBUS support into Spotify, it's a nice touch for hackers writing their own indicators and applets!

Highlighted

Re: Apple OSA script not returning playback information for new songs

Regular

When I play spotify on my iPad and keep the desktop client active too the fields are once again populated correctly.

HendrikPetertje_0-1588162630155.png


As soon as I switch from the iPad back to OSX the details disappear again.

HendrikPetertje_1-1588162644829.png

Highlighted

Re: Apple OSA script not returning playback information for new songs

Casual Listener

I've been having the same issue for the past couple weeks using osascript. Spotify ver 1.1.31.703.g256add22.  The track and artist are blank 90% of the time but the album name always shows. If I go back to a song that was showing the title, it often doesn't show it anymore. For me, it doesn't matter if I'm playing on another device or on the mac. Just running the following in terminal often returns nothing:

osascript -e "tell application \"Spotify\" to name of current track as string"

Highlighted

Re: Apple OSA script not returning playback information for new songs

Visitor

I'm seeing the same on my BitBar script to show Spotify track information on the notification center: https://github.com/mpereira/bitbar-plugins/blob/master/Music/spotify-mpereira.5s.sh

With some songs it works, but with most, osascript returns nothing.

These commands work every time:
osascript -e 'tell application "Spotify" to player state as string'
osascript -e 'tell application "Spotify" to album of current track as string'

The following don't:
osascript -e 'tell application "Spotify" to artist of current track as string'
osascript -e 'tell application "Spotify" to name of current track as string'

Highlighted

Re: Apple OSA script not returning playback information for new songs

Newbie

I noticed something similar.

 

I noticed that the `artist of current track` and `name of current track` stopped working sometimes.

 

Upon more debugging I saw that this issue takes place after I do something to the currently playing song. So if I pause it / play it / skip to the next song the song's name, artist, and album artist return an empty string. Everything else returns as expected though.

 

What's interesting though is that this error does not occur if the song starts naturally (after the previous song finished playing rather than me skipping to the next song / choosing a song). The error will start occurring once more if I pause and then play the song. User action seems to cause the bug.

Highlighted

Re: Apple OSA script not returning playback information for new songs

Casual Listener
I can confirm it's still a problem on my end. Both the song and artist name are blank when I retrieve them through OSA, though it only seems to happen when I change songs through user action (pausing, playing, skipping). It gets the information normally if the track changes on its own
Highlighted

Re: Apple OSA script not returning playback information for new songs

Spotify
Spotify

Thanks for the added details, all. I was able to reproduce the problem. We're looking into it further here at Spotify.

SUGGESTED POSTS