In a nice holiday present of enshittification, last.fm suddenly decided to charge for API access for ANY project, no matter if it was hobbyist, FOSS, commercial, or otherwise. Their policy now requires users to get Pro or *forces the developers to go pro and share their API key* (which I’m betting will quickly hit rate limits and force users to pay).
On one hand, I understand that last.fm has to make money to pay for itself. On the other hand, that service is *absolutely worthless* without the data we have given it.
Hence, a pair of scripts and a systemd unit that makes last.fm redundant. ([GitHub](https://github.com/uriel1998/keep-playcounts-current), [my repo](https://github.com/uriel1998/keep-playcounts-current))
I was already working on several scripts to gather data locally; I have here pulled out the thing I (and most people, in my experience) are interested in: tracking and synchronizing playcounts.
`Fooyin` — among other local music players — can write playcounts to MP3 tags, and `MPD` (my main player) has the stickerfile that `myMPD` and other clients can read and write to.
The first script, `sync_one_playcount.sh`, synchronizes the playcount metadata (in two fields for compatibility) in the MP3 itself with MPD’s stickerfile and — if you pay for it — last.fm’s recorded playcount. If MPD isn’t present or accessible, it still records it in the MP3 metadata, which most other media players will pick up. Because it’s BASH, it should be easily adaptable if your music player of choice reads a different tag. It can also update and synchronize playcounts for the currently playing (using MPD) track or an arbitrary directory (including, say, `~/Music`.)
The second script, `watch_mpris.sh`, uses [`playerctl`](https://github.com/altdesktop/playerctl), available in many repositories, so that your playcounts *stay* updated, regardless of player. The script uses `playerctl` to monitor *any* MPRIS-aware player it can find (you can tell it to ignore some if you like) for track changes, then calls the update script. It can either increment the playcount by one for players that do not write that tag to the file, or *not* increment it if you’re using a player like `fooyin` that writes to the tags on its own. It not only keeps track of the “last seen” track for players individually, but also writes out the basic metadata of the most recently seen track change if you have conky or other scripts that pick up and use such data. (**Note: there’s a persistent bug** where it requires pkill or kill to stop the watcher that I’m still working on, but it’s meant to be on and *stay* on, so….yeah. Not too worried.)
[See also Local Reactions And Stickers With Drag And Drop And Clipboard Support For Linux With Clipimg](https://www.ideatrash.net/2026/08/local-reactions-and-stickers-with-drag-and-drop-and-clipboard-support-for-linux-with-clipimg.html)
Me? I’m giving `last.fm` the US$5 for one month and synchronizing playcounts with my whole library. And then because I’ll have that data *here*, in ways *I* control, they won’t get a single byte or nickel more from me.
**I encourage you to use these scripts to do the same.** ([GitHub](https://github.com/uriel1998/keep-playcounts-current), [my repo](https://github.com/uriel1998/keep-playcounts-current))
A last note: I’d been working on something *far* more extensive that is now completely dead in the water. I saw the notice from last.fm the day after it was put in place. While this is built upon and adapted from code I originally hand-wrote, it’s been extensively modified by an AI tool to be these standalone scripts (and back into BASH from where I’d been using Python). **That said**, the use of this tool in no way, shape, or form requires the further use of AI/ML tools, and that’s on purpose.
- Steven
Featured Image adapted from [Novaskin](https://minecraft.novaskin.me/wallpapers/run2) and my personal Minecraft skin
Making Last FM Redundant With BASH
Submitted 1 day ago by
ideatrash@www.ideatrash.net to random@mbin.linuxnation.social
https://www.ideatrash.net/?p=147649