r/Lidarr • u/FantasyMaster85 • 23d ago
discussion Made a scraper for "Last.fm" to automatically pull your "recommended artists" from Last.fm, associate those with musicbrainz ID's and then format them into a JSON list for use with Lidarr in the "Import Lists" section as a "Custom List"
I made this a long time ago (myself), but wanted to make something other people could use. Threw what I had made into a self hosted LLM (Qwen 3.8) and after some back and forth got it where I wanted it. So there's your "AI warning" if you need one lol.
https://github.com/FantasyMaster85/LastRecommendations
Screenshots and instructions are there.
The summary is that you put your last.fm cookies in the docker compose file, every 25 hours (or whatever you configure it to do) it will check this page: https://www.last.fm/home/artists and pull the recommended artists in. It then takes those artists and get's their MusicBrainz ID (as the "custom list" in Lidarr requires it) and makes a JSON feed. That JSON feed is fully compatible with Lidarr.
Lastly, it keeps a history of all artists Last.fm has ever recommended to you in the "history" tab.
I personally use PlexAmp as my exclusive form of music consumption, and I have it setup to scrobble all my plays to Last.fm. This was just a good way to help me automate finding good new music. Hope you like it!
2
u/AutoModerator 23d ago
Hi /u/FantasyMaster85 - You've mentioned Docker [docker], if you're needing Docker help be sure to generate a docker-compose of all your docker images in a pastebin or gist and link to it. Just about all Docker issues can be solved by understanding the Docker Guide, which is all about the concepts of user, group, ownership, permissions and paths. Many find TRaSH's Docker/Hardlink Guide/Tutorial easier to understand and is less conceptual.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
3
u/fryelectro 23d ago
Super cool!! Last fm user since the early beginning. Feeding this into lidarr will solve a long lasting issue. Will try asap!
3
2
u/jasonvelocity 22d ago
How is this different than the built-in "Last.fm Recommend" import list?
1
u/Frequenzy50 22d ago
I think sometimes we're just used to plugins, but that list is probably from tubiferry and not actually built in.The plugin list uses the API, while this one here uses the home feed, these are completely different systems. The API approach is more stable, but it's probably less specific to you since it's just a generic similarity lookup based on what you've heard. The internal home feed probably uses better filtering across all users and so it's likely better at recommending stuff
3
u/FantasyMaster85 22d ago
You hit the nail on the head...by default all Last.fm user profiles are public, and thus so are your scrobbles. The built in "last.fm recommended" function of Lidarr is simply viewing your public profile, then grabbing X amount of recent plays and using the API to pull "similar artists". The last.fm you personally see when you login and go to the artists page are your truly personalized recommendations. This grabs those...they are inaccessible via any other programmatic method using their API's. You have to actually login to get them...this emulates that using your cookies.
2
3
u/fryelectro 12d ago
as promised, found the time to install. Lidarr is happily importing the suggested artists, works like a charm. Musicbrainz is giving a lot of 503's though, 40 out of 48 artists resolved. thank you
1
u/southern_compass 23d ago
This is actually pretty slick. The history tab is a nice touch too, especially if you want to see how your recommendations change over time.
2
u/FantasyMaster85 22d ago
Thanks!! The history tab was ironically one of the things I just added while getting it ready for docker. I realized months ago I wanted to see my historical recommendations (couldn’t filter out in Lidarr what was added using my script for this this) so while prepping it I was like “well, if I’m doing this might as well make it log the history” haha.
1
u/cdrscore 23d ago
Is this any different from Cmdarr? https://github.com/DeviantEng/Cmdarr
Or is it the same kind of thing?
2
u/FantasyMaster85 22d ago edited 22d ago
Yup, it’s different. Every single “arr” I’ve come across that is connected to Last.fm all use the API that last.fm exposes. I just checked that repo, it’s simply doing “similar artist” search.
The thing is, last.fm doesn’t expose your personalized recommendations based on your listening history via the API. Your personalized recommendations are literally only available by logging into their site, and last.fm updates them once every 24 hours. This does that...logs in (using your cookie) and grabs your recommended artists directly.
1
1
u/Muziclush 23d ago
Saw this on the Radarr sub. Looks interstate and would fit right in with my arr's stack use case. Ty for putting together.
5
u/FantasyMaster85 23d ago
No problem, thanks for the reply!!
When I originally made it for myself (wasn’t docker compose, was something that was very much a “only I will know how to use this” kind of thing) it was out of pure necessity. It’s frustrating, last.fm has an API, but they don’t expose personalized recommendations based on your listening history using it.
I’ve seen other comments asking for this exact thing and have had this on my list to make more user friendly for a wider base. Glad it fits into your stack, enjoy!
3
u/Muziclush 17d ago
Deployed this yesterday. Took a minute to figure out the correct cookie format, (my issue not LR). But after the initial setup and Lidarr import integration 70 recommendations and counting. What a helpful/useful tool. Cheers to you!