This is an automated archive made by the Lemmit Bot.

The original was posted on /r/selfhosted by /u/dicthdigger on 2025-06-22 09:56:31+00:00.


I did it just for fun because tired about streaming services. I think it is useful so I’m sharing it. Another addition to the self-hosted music stack! This tool has been quietly revolutionizing my music discovery.

The Stack:

  • Plex, Jellyfin, Navidrome or anything you wish for media server
  • Headphones for music management
  • Last.fm for scrobbling and recommendations
  • DiscoverLastfm (my tool) for automated discovery

What DiscoverLastfm does: Analyzes your Last.fm listening history, finds genuinely similar artists using their recommendation engine, and automatically adds their studio albums to your Plex library via Headphones integration.

Why build this? Streaming services have terrible discovery algorithms - they push whatever they’re paid to promote, not what actually matches your taste. Last.fm’s collaborative filtering is superior because it’s based on real user listening patterns accumulated over 20+ years.

Self-hosted advantages:

  • Complete control over your music library
  • No licensing restrictions removing albums
  • No ads or artificial limitations
  • Better audio quality options
  • Works offline
  • Own your data and listening history

Technical implementation:

  • Python script with configurable rate limiting
  • RESTful API integration (Last.fm + Headphones)
  • Persistent SQLite cache for duplicate prevention
  • Comprehensive logging and error handling
  • Cron job automation
  • Docker deployment ready (on my roadmap)

Real-world performance: Running for 3 months on a small VPS:

  • 200+ new artists discovered
  • ~500 albums automatically added
  • Zero manual intervention required
  • Found multiple new favorite artists
  • Library growth perfectly aligned with my taste

Resource usage:

  • Minimal CPU (runs daily for ~10 minutes)
  • ~50MB RAM during execution
  • Network: Respectful API calls with exponential backoff
  • Storage: Just the new music it discovers

The beauty of self-hosting this vs relying on Spotify/Apple Music algorithms is that you get genuine discovery without commercial bias, plus you actually own everything.

Setup requirements:

  • Last.fm account with substantial listening history
  • Headphones instance for music management
  • Python 3.6+ environment
  • Basic cron job knowledge

GitHub: https://github.com/MrRobotoGit/DiscoveryLastFM

Perfect complement to anyone running a self-hosted media stack. The “set it and forget it” nature fits perfectly with the self-hosted philosophy.