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
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txtBasic run:
python app.py \
--lastfm-user YOUR_LASTFM_USERNAME \
--lastfm-api-key "$LASTFM_API_KEY" \
--limit 30Liked-only run:
python app.py \
--lastfm-user YOUR_LASTFM_USERNAME \
--liked-only \
--providers ytmusic \
--ytmusic-auth headers_auth.jsonLiked-only run (YouTube Music + Spotify):
python app.py \
--lastfm-user YOUR_LASTFM_USERNAME \
--liked-only \
--providers ytmusic,spotify \
--ytmusic-auth headers_auth.jsonDry run:
python app.py --lastfm-user YOUR_LASTFM_USERNAME --liked-only --dry-runBackground/daemon mode (continuous polling):
python app.py \
--lastfm-user YOUR_LASTFM_USERNAME \
--liked-only \
--daemon \
--poll-interval 900Download 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, andgenrewhen 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
ffmpegto be available on your system. - Already-downloaded tracks are metadata-refreshed on subsequent runs (unless
--no-metadatais 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- Create/get API key: https://www.last.fm/api/account/create
- Set env var or pass via CLI:
export LASTFM_API_KEY="your_lastfm_api_key"export SCROBLOAD_OUTPUT_DIR="/path/to/downloads"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"- Generate
headers_auth.jsonwith ytmusicapi setup: https://ytmusicapi.readthedocs.io/en/latest/setup/browser.html
Install:
chmod +x scripts/install_ubuntu.sh scripts/uninstall_ubuntu.sh
sudo ./scripts/install_ubuntu.sh --lastfm-user YOUR_LASTFM_USERNAMEUseful 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-pagerUninstall:
sudo ./scripts/uninstall_ubuntu.sh
sudo ./scripts/uninstall_ubuntu.sh --purge-downloadsBuild 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.shBuild Debian package:
./scripts/build_deb.shBuild Arch package:
./scripts/build_arch_pkg.shBuild both:
./scripts/release_packages.shPKGBUILD assets:
packaging/arch/PKGBUILD.inpackaging/arch/scrobload.install
- Matching is best-effort (
artist + titlenormalization). - 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.