Page 1 of 1

iTunes Internet Radio metadata

PostPosted: Mon May 07, 2018 8:08 pm
by Monstergerm
I sometimes listen to Internet Radio stations on iTunes (the old fashioned ones listed under 'Internet Radio'.
The official iTunes plugin does not support them, it lost Playlist support long time ago and it puts the Internet Radio Station name into the Track field.
I can however get the required metadata via Applescript (current stream title). I modified the iTunes Local Control plugin to put this information into a variable.

In other words I have a variable that holds the stream title (Artist & Song name). My question is, how do I keep this variable updated?
I need something like this: if iTunes is playing and Playlist is "Internet Radio" then update this variable with the current stream title every lets say 10 seconds. I can't use any triggers here since the iTunes device via the official iTunes plugin does not support streaming titles.

What would be a good way to have some repeat timer run conditionally while above is true and update the variable?

Re: iTunes Internet Radio metadata

PostPosted: Tue May 08, 2018 7:12 am
by kmarkley
Hi Mostergerm.

Support for streams in the iTunes Local Control plugin is a good idea - I'll add it to the list.

For your specific situation, I would run a schedule to put the current playlist in a variable. A second schedule could get the current stream title, but only if the playlist variable is "Internet Radio".

Re: iTunes Internet Radio metadata

PostPosted: Tue May 08, 2018 3:37 pm
by Monstergerm
perfect! this works.

If you want to implement in your plugin, this is what I found out:

Code: Select all
tell application "iTunes"
   set myPlaylist to name of current playlist -- becomes 'Internet Radio' with radio
   set myAlbum to (get album of current track) -- missing value with radio
   set myArtist to (get artist of current track) -- missing value with radio
   set myTrack to name of current track -- becomes Radio station name
   set mystreamTitle to current stream title -- missing value with Music;  Artist & Song with radio
   set mystreamURL to current stream URL -- missing value with Music;  URL of radio station
end tell