trackupdate polls Apple Music for information about the currently playing track and hands this information to target plugins to perform various tasks.

grahams, updated 🕥 2023-01-15 16:22:57

trackupdate v1.2 (c) 2009-2020 - Sean M. Graham

This code exists under an MIT license, see LICENSE for details


trackupdate polls Apple Music every 10 seconds for information about the currently playing track and hands this information to target plugins to perform various tasks. The currently included plugins are:

  • StdioTarget - Prints the current artist and track to stdout (aka "the terminal")
  • AudioHijackTarget - Places the current track info into Audio Hijack's "NowPlaying.txt" file
  • LadioCastTarget - Updates the metadata in Ladiocast using Applescript
  • ListFileTarget - Creates some text files which can easily be pasted into Mediawiki and HTML, and also creates a simple track list text file
  • SlackTarget - Posts track info into a Slack channel
  • TwitterTarget - Posts each track's artist and name to a twitter account specified in the .rc file. Requires that python-twitter is installed (

trackupdate and some of its plugins require configuration data, which is stored in a file named ~/.trackupdaterc. See example-trackupdaterc for details on the various configuration options.

While this script is running, you may notice a persistent bouncing dock icon for python. This annoyed me, so I removed it by editing:


and adding the following key to the tag: NSUIElement 1


Make Backblaze target so it's not hardcoded to jpegs

opened on 2021-01-26 03:40:43 by grahams

Right now we use a field in the rcfile to determine the default cover image path. This is ok, but it should default to a pattern or even the current date or something.

Check that file exists before uploading to Backblaze

opened on 2021-01-26 03:39:47 by grahams

If the file on disk does not exist, we shit the bed with a stack trace. Also, a failure here should not crash the application.

Line of interest:


```bigpapi:[~/src/trackupdate]$ ./ -e 338 [master] Traceback (most recent call last): File "./", line 333, in updateTrack plugin.logTrack(track, startTime) File "/Users/grahams/src/trackupdate/plugins/", line 78, in logTrack self.bucket.upload_local_file( File "/usr/local/anaconda3/envs/trackupdate/lib/python3.8/site-packages/logfury/v0_1/", line 84, in wrapper return function(wrapee_args, **wrapee_kwargs) File "/usr/local/anaconda3/envs/trackupdate/lib/python3.8/site-packages/b2sdk/", line 402, in upload_local_file upload_source = UploadSourceLocalFile(local_path=local_file, content_sha1=sha1_sum) File "/usr/local/anaconda3/envs/trackupdate/lib/python3.8/site-packages/b2sdk/transfer/outbound/", line 84, in init raise InvalidUploadSource(local_path) b2sdk.exception.InvalidUploadSource: Invalid upload source: /Users/grahams/Resilio Sync/Public/programme/covers/20210125.jpg

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "./", line 381, in trackUpdate = TrackUpdate(sys.argv[1:]) File "./", line 190, in init self.liveLoop() File "./", line 231, in liveLoop self.processCurrentTrack(track) File "./", line 318, in processCurrentTrack self.updateTrack(track, self.startTime) File "./", line 335, in updateTrack logging.error(plugin + ": Error trying to update track") TypeError: unsupported operand type(s) for +: 'BackblazeTarget' and 'str' ```