Scrobbling RTBF live radios to Last.fm and ListenBrainz with userscripts

Finding a way to scrobble live RTBF radios like Classic 21 and Classic 21 Metal to Last.fm and ListenBrainz was not as straightforward as it should have been.

I've stopped Spotify for a long time and I have switched to Navidrome and Jellyfin/Finamp on Android, which embark scrobblers for Last.fm and ListenBrainz, luckily for me.

However in the universe of music scrobblers, I had yet to find how to scrobble my favorite local radios, RTBF Classic21 and Classic21 Metal (https://www.rtbf.be/radio/liveradio/classic21_metal) πŸŽΈπŸ‡§πŸ‡ͺ.

They integrate a player compatible with an awesome web-scrobbler extension (https://github.com/web-scrobbler) whose purpose is to work for live radios web players. Sadly I couldn't make it work with those radios despite history is showing it is supposed to have worked years ago. There is an integration for RTBF live radios at https://github.com/web-scrobbler/web-scrobbler/pull/2377/files - it was supposed to work for Classic 21 as well, unfortunately the code seems obsolete now and I couldn't ship a working fix for this. So I paused a bit, and gave up, ... not long enough πŸ˜‚.

I had the idea of running Shazam in the background and send it findings to some backend for scrobbling my songs, and I thought it would be very epic and complicated. I did try anyway the Shazam web extension and noticed that it would mismatch the song and artist displayed on the radio website most of the time. This is concerning. Why is that? I do not know yet, so just in doubt I have contacted the website admin for RTBF about this.

Anyway, diving back into the code and opening Dev Tools in Brave, helped me discover an interesting URL: https://core-search.radioplayer.cloud/056/qp/v4/events/?rpId=29 which returns the songs being played for this radio, I mean the recent ones, the next one and the one currently playing!

Then I decided to try hacking my own solution for this problem. It wouldn't work with Navidrome nor with a chrome extension, I wanted a simple minimalist hack. I'm used to tweak websites UX with Tampermonkey and I'd to give a try. The result is https://gitea.zoemp.be/sansguidon/snippets/raw/branch/main/tampermonkey/rtbf_scrobbler.js.

I’ve adopted ListenBrainz as an alternative to Last.FM, but I still can’t fully let go of it. That’s why my userscript supports both, and it's hackable for those who want to extend it πŸ˜‰

I've tested it on:

And it should likely be compatible with most radios at:

My scrobbling profiles are https://www.last.fm/user/SansGUidon and https://listenbrainz.org/user/SansGuidon/.

Feel free to share, copy, reuse and provide feedback! I'll keep this post updated if RTBF radio answers my questions πŸ˜‰ or if I get interesting feedback. I've also mentioned this post in https://github.com/web-scrobbler/web-scrobbler/discussions/5327.

πŸ’Œ The best way to get in touch is via my email morgan at zoemp dot be. You can also follow me on the Fediverse / Mastodon at @sansguidon@mamot.fr. I speak (a lot) French, English and a bit of Dutch.


Hello world

For this first blog post, I want to encourage you to reflect and care more about yourself, be more aware of who you really are, what you really want and love, and instead of trying to please the entire world, try to first please you.

  • Don't chase for perfection.
  • Don't try to keep up with every trendy tool at your disposal.
  • Don't try to read every recommended book or watch every new TV show.
  • Don't take all advices, critics, judgments personally nor as if they were always true.
  • Dare to say no more often, say no to a proposal, say no to a request, say no when you are unsure, in order to protect your time and focus more on what you said yes to.
  • Don't obey to all advices and best practices, blindly. Take which applies best to your situation.
  • There is no standard for a curriculum vitae, it's supposed to be an extension of yourself, not a demo of a perfect template.

Be yourself.

Mastodon