Announcements

Help Wizard

Step 1

NEXT STEP

Apple OSA script not returning playback information for new songs

Apple OSA script not returning playback information for new songs

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

Reply
19 Replies

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

 

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

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!

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

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"

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'

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.

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

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

I am experiencing this same behavior. I just noticed it this week myself. If i play the song in the app the artist and missing items appear. but playing on the desktop they items disappear.

Hi all, thanks again for reporting this issue. We've made a few improvements to the desktop app. Would you mind trying again in the latest version (1.1.34.422 or newer)?

HI! how can I download latest version to check this? Im on 1.1.32.618.gda5638a6 and no updates appears

Good question @cherya. It may be a while before the new version that I mentioned will show up for everyone. I will update the thread here after there is a new version you can download.

I just got the update notice, but it only seems to go up til 1.1.33.569; so I guess we have to wait a tad more.
Problem still persists in this version, but will report back once I reach 1.1.34.422

Hey there, thought I reach out here real quick.

I just updated spotify to 1.1.34.694.gac68a2b3 and noticed that all problems related to Spotify playback status on OSX are gone. The track object in OSA contains all info it should have and all my terminal addons, indicators (and even the spotify now playing bar on my touchbar) woke back to life.

Thanks for fixing this!

giphy.gif

Still waiting for the new update. Is the only way to move to the next version is to wait until the app says it's ready? I still have not seen version 1.1.34.694.gac68a2b3

Waiting Patiently 🙂

Finally got the 1.1.34.694 update today and can also confirm it's working so far! Thanks for patching this up!

Glad to hear it! I think the latest version should be available for everybody now. Let us know if you still don't see it, @paul_1994.

I just reinstalled the app from the spotify download site, instead of waiting for the app to update.
After I installed the latest app everything is well again 🙂

Suggested posts