meine
meine 🌒 - A CLI file manager and system utility built with Textual. It combines intuitive command parsing with rich t…
Sync music playlists between your local music library and Plex!
git clone https://github.com/XDGFX/PPP.gitXDGFX/PPPPlex Playlist Pusher (Python Re-write)
Looking for the original Bash version? Find it here
A simple Python 3 script used to automatically:
This will keep Plex playlists and local playlists synchronised. If you want to delete a playlist or song from a playlist, it must be removed from BOTH local and Plex playlists.
usage: PPP.py [-h] [-setup] [-nobackups] [-retention n] [-nocleanup]
optional arguments:
-h, --help show this help message and exit
-setup Force-run the setup procedure
-nobackups Disable backup of local playlists completely!
-retention n Number of previous local playlist backups to keep (Default 10)
-nocleanup Disable removal of .tmp directory (for debugging only)
PPP will guide you through a setup on first run, and attempt to help you find all required variables.
Alternatively rename example-variables.json to variables.json and edit the file manually.
Use crontab. You may need to apply this fix.
Example crontab:
* * * * * cd /path/to/PPP && /usr/bin/python3 /path/to/PPP/PPP.py >> /path/to/PPP/PPP.log 2>&1
Use task scheduler? I haven't tested it.
Running setup should help you find all these variables!
| VARIABLE | DESCRIPTION | EXAMPLE |
|---|---|---|
server_url |
the url of your Plex server, as seen by whatever you're running PPP on | "http://192.168.1.100:32400" |
check_ssl |
validate, or ignore SSL certificate ('"False"' for self signed https) | "True" |
plex_token |
find it here | "A1B3c4bdHA3s8COTaE3l" |
local_playlists |
path to the local playlists you want to use, relative to PPP | "/mnt/Playlists" |
working_directory |
path to PPP working directory, a directory accessible by both PPP and Plex | "/mnt/PPP" |
working_directory_plex |
path to PPP working directory as seen by Plex. Change it if Plex is running in a container and cannot see working_directory |
"/data/mnt/PPP" |
section_id |
the library section which contains all your music (only one section is supported by the Plex API) | "11" |
local_prepend |
path to be ignored in local playlists | "Z:\\Media\\Music\\" |
plex_prepend |
path to be ignored in Plex playlists | "/mnt/Media/Music" |
local_convert |
only if local playlists are in a different directory format to your PPP machine | "w2u" |
plex_convert |
only if you Plex playlists are in a different directory format to your PPP machine | False |
--- EXAMPLE LOCAL_PLAYLIST ---
Z:\Media\Music\Andrew Huang\Love Is Real\Love Is Real.mp3
Z:\Media\Music\Ben Howard\Noonday Dream\A Boat To An Island On The Wall.mp3
Z:\Media\Music\Bibio\PHANTOM BRICKWORKS\PHANTOM BRICKWORKS.mp3
--- EXAMPLE PLEX_PLAYLIST ---
/mnt/media/Music/Andrew Huang/Love Is Real/Love Is Real.mp3
/mnt/media/Music/Ben Howard/Noonday Dream/A Boat To An Island On The Wall.mp3
/mnt/media/Music/Bibio/PHANTOM BRICKWORKS/PHANTOM BRICKWORKS.mp3
In the examples above, local_prepend is "Z:\\Media\\Music\\" and plex_prepend is "/mnt/Media/Music"
In this example, PPP is running on a machine which uses UNIX paths (/ not \), and so local_convert is "w2u" - which means Windows paths are converted to UNIX paths.
If running PPP on Windows and your playlist paths are UNIX, use "u2w", and if both paths are the same format use false.
Why are there so many backslashes? You need to double any backslash, because normally it's a special 'escape character' which would break the code. You need to 'escape' the 'escape character' (https://stackoverflow.com/questions/19095796/how-to-print-backslash-with-python)
more like this
meine 🌒 - A CLI file manager and system utility built with Textual. It combines intuitive command parsing with rich t…
Create and add progress bars, Office365 Files and Dropbox Paper papers by labels and link them to your Todoist tasks.
search projects, people, and tags