My customizations are based on the original source script from Plex forums user freshprince.
To install dependencies (PlexAPI, libpytunes), use the provided pyproject.toml file and the Poetry docs.
poetry install
Alternatively, manually download libpytunes from https://github.com/liamks/libpytunes and install any other prerequisites using your preferred method.
Create a config.py containing:
plexUrl = 'http://< PLEX IP ADDRESS OR URL >'
plexName = '< PLEX SERVER NAME >'
plexToken = '< PLEX SERVER TOKEN >'
plexMusicLibrary = '< PLEX MUSIC LIBRARY NAME >'
appleMusicLibraryName = '< LIBRARY XML FILE TO IMPORT>.xml'
Use the helper script get_token.py to generate a Plex authentication token.
Run the import_ratings.py script using the following command:
poetry run python import_ratings.py
Upgrade dependencies using Poetry:
poetry update
Alternatively, manually download libpytunes from https://github.com/liamks/libpytunes and update any other prerequisites using your preferred method.