03 July 2025
Today, I made my itunes-scrobbler repository public.
The repository contains a Python script that reads a legacy iTunes XML file1 and scrobbles music plays to Last.fm. The script is basic but functional: it caches previously scrobbled plays and only submits new ones. The README.md includes all the steps needed to get it running. If you encounter any issues, feel free to open an Issue on the repository.
So, why did I build this?
Over the past month, I’ve been working on a project I’ll write more about later. One part of that project involved buying an iPod Classic. Nostalgia is a powerful emotion, and it’s been genuinely fun rediscovering albums in the streaming era.
Since the iPod Classic doesn’t work with Apple Music, I didn’t want to connect it to the Music Library I’ve had on my Mac since 2004. That library contains thousands of songs I ripped from CDs, purchased from the iTunes Store, or added via Apple Music. Instead, I created a new user account on my Mac that isn’t linked to any Apple ID. This gave me a clean Music library, which I’m slowly populating with MP3s to sync with my iPod.
I’ve been a regular Last.fm user since 2018. When I briefly tried Spotify—a trial that didn’t stick—I decided to consolidate my listening history through Last.fm. These days, I try to scrobble all my music plays there. Naturally, I wanted my iPod play counts to show up in my Last.fm profile. So I spent a few hours and wrote this script.
The script works best on small or new libraries—like mine. I wouldn’t recommend running it against a large or heavily played library, as it may corrupt your Last.fm history.
When iTunes was replaced by Music.app, the automatic creation of the iTunes Music Library XML file was removed. This XML file was originally used by third-party apps to interact with your iTunes library. Thankfully, there’s an app called Music Library Exporter that can generate the XML file from your current Music library—something I desperately needed for this project. ↩