Easy way to access metadata of 'now playing' song
First of all, thanks for this great player!
I am using strawberry to playback songs for my radio stream and I am trying to find out how I can extract metadata information of the currently playing song to forward it to my radio stream as well.
Is there an easy way to access that data? I am on a mac, and I already tried monitoring ~/Library/Application Support/Strawberry/strawberry.db for changes, but could only find 'lastplayed' is updated once a song is finished.
I also tried intercepting desktop notifications, but without any luck.
I know this is sort of an unusual use case as I am not using Strawberry to stream to my radio server but another software, however, I would be really grateful for any hints!
My (rather crude) solution involves fetching currently playing song's data from Strawberry's window title.
The code is roughly equivalent to the following (inline cmd, Windows):
@chcp 65001 >nul 2>&1 for /f "tokens=2,* skip=9 usebackq" %i in ( `tasklist /v /fo list /fi "imagename eq strawberry.exe" 2^>nul` ) do @echo %j
However, I can only extract the song's artist and title with this - not to mention it's not configurable.
There must be a better way...
jonas last edited by
I think it should be possible to enable D-Bus on macOS.
Some instructions here: https://github.com/zbentley/dbus-osx-examples/blob/master/installation/README.md
The macOS versions of Strawberry is compiled with MPRIS2 D-Bus support.
I have never tested it though, so I can't say if it works or not.