Self Hosted Music and Scrobbling

So, I love Last.fm. I love tracking what I listen to and getting those little insights into my music habits, even if they are not always that surprising. If I were “less broke” I would subscribe to their cheap monthly plan just to support the service. I don’t plan to stop using them, but in this modern age where everything inevitably ends up enshitified I decided it would be a good idea to set up a self hosted scrobbling service.

Some searching gave me Maloja, which feels like it is probably a word with a meaningful definition I am not aware of, but searching doesn’t give anything. It runs with Docker, which is nice. I set up the container and got it running. I downloaded and imported my last.fm history as well. Then I went to set up Panoscrobbler, which I use on my phone. Panoscrobbler and do more than one scrobble target, so it can do Maloja and Last.fm. Except it apparently doesn’t like using HTTP. Because Maloja is just on my home server it just sits at IP:port. You can’t set up HTTPS SSL certs against an IP.

I remembered something I had seen recently and asked Claude about, an SSH Proxy tunnel. So I asked Claude about it, and got a set up guide, which was mostly familiar. Aside from the tunnel itself, which was just setting up.an SSH based service, the rest was things I had done before. I needed a subdomain, easy, I needed to set up a virtual host for it, easy, I needed to run Let’s Encrypt against it, easy.

And now the scrobble service is set up at maloja.lameazoid.com, as well as on my last.fm. Panoscrobbler can be configured to target multiple services at once.

I also, for reasons I can’t quite remember, have more than one last.fm account. I went ahead and downloaded data from all three accounts, and dumped them into Maloja, for a slightly more complete image of my listening history. There were about 6000 scrobbles with bad time stamps, but I was able to get into the SQLite database and purge those out. Surprisingly, not much changed in my “All Time” numbers other than Pink Floyd and Nobuo Uematsu rank much higher now. Which is fine, both were frequent listens before I started using Last.fm.

I also can hit this service now without being VPN connected to my home network, which is a bonus.

Which gave me another idea. Why stop at scrobbles, I can do the music too. Another recent project was trying to get a better self hosted music streaming set up. Basically, self hosted Spotify. I had set up a music only Jellyfin account but that was a bit janky. I recently had discovered and set up Navidrome, which is much nicer and designed for Music. I followed the same tunneling procedure and now I can take my personal music library, which Navidrome tells me is 38,000 tracks, and listen to it everywhere much more easily.

But why stop there? What else can they new shiny tools do? It turns out Maloja has an output API. I turned to Claude again and had it make up a script that will create a weekly digest markdown record of weekly top 5 for artist, albums, and songs, as well as a dump of every scrobble. It stumbled a bit on the date format for the API, which is pretty poorly documented, but after feeding it the code from Maloja, it was able to decipher the proper format.

And even more fun, as part of an unrelated recent project, I now have the CLI version of Joplin running on my project server. So I have the script also push this weekly summary to my Joplin notebook.

But wait, there’s more! What about, the old scrobbles? Well, I have a script that makes weekly digests, the next step was a slightly altered script that would loop through all of the weeks from today back to 2005, making digest files. I mean, no one, including me will probably ever look at this but I have it down, and its going to make new ones automatically going ahead.

Leave a Comment

Comments

No comments yet. Why don’t you start the discussion?

    Leave a Reply

    Your email address will not be published. Required fields are marked *

    This site uses Akismet to reduce spam. Learn how your comment data is processed.