Skip to content
AngelBeProPublic

About

A simple python app that downloads your scrobbles. Made with the help of AI

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

27 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Scrobload

Scrobload fetches your latest Last.fm scrobbles and downloads the tracks.

It can also run in liked-only mode, where it downloads only tracks that are liked in:

  • Spotify
  • YouTube Music

1) Quick start

python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

Basic run:

python app.py \
  --lastfm-user YOUR_LASTFM_USERNAME \
  --lastfm-api-key "$LASTFM_API_KEY" \
  --limit 30

Liked-only run:

python app.py \
  --lastfm-user YOUR_LASTFM_USERNAME \
  --liked-only \
  --providers ytmusic \
  --ytmusic-auth headers_auth.json

Liked-only run (YouTube Music + Spotify):

python app.py \
  --lastfm-user YOUR_LASTFM_USERNAME \
  --liked-only \
  --providers ytmusic,spotify \
  --ytmusic-auth headers_auth.json

Dry run:

python app.py --lastfm-user YOUR_LASTFM_USERNAME --liked-only --dry-run

Background/daemon mode (continuous polling):

python app.py \
  --lastfm-user YOUR_LASTFM_USERNAME \
  --liked-only \
  --daemon \
  --poll-interval 900

Download location control:

  • CLI parameter: --output-dir /path/to/downloads
  • Environment variable: SCROBLOAD_OUTPUT_DIR=/path/to/downloads

Audio format control (default: mp3):

  • CLI parameter: --audio-format mp3
  • You can set other formats supported by ffmpeg/yt-dlp postprocessing (examples: ogg, opus, m4a, flac)

Metadata tagging for media servers (Navidrome/Jellyfin/Plex):

  • Scrobload enriches tracks primarily from Last.fm (track.getInfo + album.getInfo) and falls back to YouTube/MusicBrainz when needed.
  • Downloaded files are tagged with title, artist, albumartist, album, date, track, and genre when available.
  • Album cover art is fetched from Last.fm first, then MusicBrainz Cover Art Archive as fallback, and embedded when possible.
  • This helps media servers categorize tracks under artist/album views.
  • Requires ffmpeg to be available on your system.
  • Already-downloaded tracks are metadata-refreshed on subsequent runs (unless --no-metadata is used).

Delete protection (enabled by default):

  • If you manually delete a previously downloaded track file, Scrobload remembers that and will not download it again.
  • To disable this behavior and allow re-downloading deleted tracks, pass: --redownload-deleted

Example:

SCROBLOAD_OUTPUT_DIR="/srv/music/scrobload" python app.py --lastfm-user YOUR_LASTFM_USERNAME --audio-format ogg

2) Credentials

Last.fm

export LASTFM_API_KEY="your_lastfm_api_key"

Optional app env vars

export SCROBLOAD_OUTPUT_DIR="/path/to/downloads"

Spotify (optional, only if providers include spotify)

export SPOTIPY_CLIENT_ID="your_client_id"
export SPOTIPY_CLIENT_SECRET="your_client_secret"
export SPOTIPY_REDIRECT_URI="http://127.0.0.1:8888/callback"

YouTube Music (only if using provider ytmusic)


3) Ubuntu server install (systemd)

Install:

chmod +x scripts/install_ubuntu.sh scripts/uninstall_ubuntu.sh
sudo ./scripts/install_ubuntu.sh --lastfm-user YOUR_LASTFM_USERNAME

Useful flags:

  • --interval 15min
  • --all-scrobbles
  • --providers ytmusic
  • --ytmusic-auth headers_auth.json

To run as a long-running background process with systemd, set daemon args in /etc/scrobload.env, e.g.:

SCROBLOAD_ARGS="--lastfm-user YOUR_LASTFM_USERNAME --liked-only --daemon --poll-interval 900 --output-dir /var/lib/scrobload/downloads"

After install:

sudo systemctl start scrobload.service
sudo systemctl status scrobload.timer
sudo journalctl -u scrobload.service -n 100 --no-pager

Uninstall:

sudo ./scripts/uninstall_ubuntu.sh
sudo ./scripts/uninstall_ubuntu.sh --purge-downloads

4) Packaging

Build both package formats from this repo:

  • Debian: .deb
  • Arch: .pkg.tar.zst (PKGBUILD-compatible)
chmod +x scripts/build_deb.sh scripts/build_arch_pkg.sh scripts/release_packages.sh

Build Debian package:

./scripts/build_deb.sh

Build Arch package:

./scripts/build_arch_pkg.sh

Build both:

./scripts/release_packages.sh

PKGBUILD assets:

  • packaging/arch/PKGBUILD.in
  • packaging/arch/scrobload.install

Notes

  • Matching is best-effort (artist + title normalization).
  • Downloads are searched via YouTube Music (music.youtube.com) for more song-focused results, but exact versions can still vary.
  • Download tracking metadata is stored in OUTPUT_DIR/.scrobload_state.json.
  • Use responsibly and in line with your local laws/platform terms.

About

A simple python app that downloads your scrobbles. Made with the help of AI

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages