Helper script to get music videos into Plex and form a large playlist of them
This program modifies your Plex database. I have never had an issue with this, but if you are at all worried or attached to your current Plex setup, make sure you backup your database before using this!.
I have only tested this in Windows.
pip install -r requirements.txt
(See below for step-by-step instructions.) In your environment or in a .env file, specify the location of
- VIDS_FOLDER: a folder with your videos for "vids_folder". This is the same folder that you set up in "Local Media Assets" under "Agents -> artists" in Plex settings
- PLAYLIST_NAME: the name of the playlist you made in plex
- DUMMY_ROOT: a folder to place dummy mp3s. This folder should be in your music library. (Highlight Library, click plus sign to add, specify folder in "Add folders to library")
- FFMPEG_BIN: path to FFMPEG (something like c:\ffmpeg\bin). Only required if you want to use the normalize option
python plex-musicvids.py [cmd]
Valid commands
analyze
: Determine if there are any detectable problemsnormalize [infile] [outfile]
: adjust the audio of a file or multiple filesmake_dummies
: add artists to Plex library by making a fake mp3add_to_playlist
: add music videos to the playlist
- Make sure your videos are all in one folder and named like
FolderName/Artist Name - Descriptive Text.ext
- (Optional) Normalize your tracks with
python plex-musicvids.py normalize
- Launch the Plex Web App
- Choose Settings from the top right of the Home screen, then choose the Server from the settings sidebar
- Choose Extras (and make sure that you’re showing Advanced settings)
- In the Global music video path field, specify the full filesystem path to the location of where your music videos are stored
- Save the setting
- Create a playlist
- Create a folder for dummy tracks
- Add the dummy folder as a music library
- Run
copy .env.template .env
. Open .env and enter your dummy folder, music video folder, and playlist name. - Run
python plex-musicvids.py make_dummies
and then refresh your library - Go to the artists and make sure the music videos are found
- Run
python plex-musicvids.py analyze
to check for any problems. You may need to adjust some artist names in the video files to match what Plex expects - Once you have all the videos recognized, add them to the playlist using
python plex-musicvids.py add_to_playlist
After the collection is working, you can add new videos easily. If the new videos are already known artists, you can just
python plex-musicvids.py add_to_playlist
. Otherwise, you may need to make_dummies
first.
My preferred way to add them is
python plex-musicvids.py normalize path_of_new_video music_video_folder
python plex-musicvids.py make_dummies
python plex-musicvids.py add_to_playlist
When adding a video with an existing artist, Plex may not pick up on the change, and the dummy folder needs to be
deleted and re-added. Try python plex-musicvids.py troubleshoot
and python plex-musicvids.py make_dummies
if
this happens.