Relay loved track ratings from Plex to ListenBrainz and/or Last.FM.
ListenBrainz also supports hated tracks.
The relay is one-way from Plex to the other services - Plex track ratings will not be modified.
The script will un-love/hate tracks, but only ones that it added. This way, if you have existing loved/hated tracks that you manually set, they won't be removed.
Fill out the required values. If using Docker, these are in docker-compose.yml
. Otherwise, rename env.example
to .env
and set them there.
SERVER_URL
: the URL of your Plex serverMUSIC_LIBRARY
: by default, this is set to "Music". If your library is named something else, change this value.LOVE_THRESHOLD
: by default, this is set to 10 (5 stars). Ratings are out of 10, so 1 star in the Plex UI = 2/10.- (optional)
HATE_THRESHOLD
: If you want to use hated tracks with ListenBrainz, uncomment this.
- (optional)
- ListenBrainz and/or Last.FM API values
- Fill out one or both of these sets of values.
After setting the required environment variables, you must manually authenticate with Plex. To do so, run:
sudo docker compose run --rm ratingrelay
You should be prompted for your Plex authentication details. After this you can either let the script finish or press Ctrl+C
to finish it.
Then, you can set the container to execute however often you like. You can change the frequency on this line:
ofelia.job-run.ratingrelay.schedule: "@every 24h" # how often to run
After everything is set up, run:
sudo docker compose up -d
- Install uv
- In the repository directory, run
uv sync --frozen
- Run the script with:
uv run /path/to/repo/ratingrelay.py
- Note: The first time the script runs, you will be prompted to enter your Plex authentication details.
- If you wish, you can also run with
/path/to/repo/.venv/bin/python /path/to/repo/ratingrelay.py
To run on a regular basis, set up a cronjob (Linux) or Scheduled Task (Windows).