1.9 KiB
1.9 KiB
Navidrome to MusicBrainz Ratings Push
This script reads ratings from Navidrome over its Subsonic API and submits them to MusicBrainz.
It supports:
- song ratings -> MusicBrainz recordings
- album ratings -> MusicBrainz release groups
- artist ratings -> MusicBrainz artists
For songs, it will also expand a release-group match and rate every matching recording it can find in that group instead of stopping at the first one.
Setup
-
Install dependencies:
python -m pip install -r requirements.txt
Optional: run inside a Python virtual environment (recommended)
-
Windows (PowerShell):
python -m venv .venv .\.venv\Scripts\Activate.ps1 python -m pip install -r requirements.txt -
Windows (cmd.exe):
python -m venv .venv .\.venv\Scripts\activate.bat python -m pip install -r requirements.txt -
Unix/macOS:
python3 -m venv .venv source .venv/bin/activate python -m pip install -r requirements.txt
-
Set your Navidrome and MusicBrainz credentials:
-
NAVIDROME_BASE_URL -
NAVIDROME_USERNAME -
NAVIDROME_PASSWORD -
MB_USERNAME -
MB_PASSWORD
-
-
Run the script:
python musicbrainz-ratings-helper.py
Useful flags
--navidrome-base-url,--navidrome-username, and--navidrome-passwordto override environment variables--entity song --entity album --entity artistto limit what gets exported--dry-runto preview submissions--max-targets 1to limit a dry run to the first resolved target--no-expand-release-groupsto disable release-group fan-out for songs
Notes
- The script submits one through five star ratings and converts them to MusicBrainz's 0-100 scale.
- Zero ratings are skipped.
- MusicBrainz requires authenticated XML POST submissions and a meaningful client string.
- Navidrome access uses the Subsonic API only; the script does not read the database directly.