ALL THESE ARE EXPERIMENTAL
Mainly to aid with importing iTunes metadata, and downloading files for offline playing on a hardware device like a car stereo, boom box, legacy mp3 player etc. The scripts can probably be useful as examples on how to use the Plex API since documentation is not very, shall we say, verbose.
Exports playlists and other library items to file ystem directories such as car head unit SD cards, boom boxes etc. Will also transcode any items that do not match the supported file types of the device. Items and transcoding is configured by a plex_download.cfg
file placed in the export directory, see below.
Example download configurations for common use cases. For any random mp3 player you can just copy the one in the MP3 player
folder and add your own items.
Creates a playlist containing all tracks which are deemed duplicate (having same name, nearly same length, see code for details). This playlist is named "Duplicates (lower bitrates)" and contains every duplicate except the one with the highest bitrate and highest quality codec. The idea being that, right after running this script, you can delete the tracks in this playlist to save space while keeping the highest-quality copy of that song.
Does what it says. This can be useful when testing out the playlist import. There is actually no way of doing this inside Plex without deleting playlists one-by-one.
Not really a script, but a small gift if you're running a Yamaha MusicCast system and it won't play your Apple lossless files
Imports ratings from iTunes
Imports artist/album/track names from iTunes
Imports playlists from iTunes
Does not sort your playlists, however it will help you with sorting like this: when run, it will add | characters at the beginning of every playlist, so those existing ones will sort after any playlists added onwards. If you do this right after importing from iTunes you can distinguish your new playlists from imported ones in a nice way. The | character is also used as a "hierarchy" delimiter with other scripts here, giving you a nice substitute for iTunes playlist folders.
Helper script for the others. Don't run it directly.
Run this to install 3rd party dependencies for these scripts
Copy this file name it itunes_plex.cfg
and put your Plex and iTunes (if applicable) configuration here
Run this and log in to your Plex account to get an API token which you can then put in itunes_plex.cfg
to make the gears of these scripts run smoothly.
You are here
See files in Download CFGs folder for examples of these settings values
codec:
transcoding codec to use
container:
container format for transcoding output.
quality:
quality setting when transcoding. These work differently for different transcoding formats, see example configurations and FFMPEG documentation.
supported formats:
list of combinations of codec/container that the destination media player supports
/playlist/Road trip 2020
Get a named Plex playlist.
Also, if you don't a prefix (the thing starting with / ) the script will assume that you want a playlist with that name. In other words, for playlists you can skip /playlist/
at the start if you want.
/year/1985
Get all songs from this year
/album/Hysteria/Def Leppard
Get an album in the form /album/TITLE/ARTIST
/artist/Tangerine Dream
Get all tracks by an artist
/latest/100
Get the N latest tracks added to your Plex library.
- Plex server set up somewhere
- Plex account (not using any Plex Pass features that I'm aware of)
- Python 3
- Homebrew (for install script, dependencies can be manually installed just as well)
- Python plexapi
- libpytunes
- mutagen
- ffmpeg
All these except Python 3 and Plex itself will be installed by the install.sh
script. These Plex scripts can be run by another computer talking to the Plex server, the machine running the script does not need Plex server (or desktop client) installed.
- run install.sh script
- run get_token.py (see instructions above) to get your Plex login token, then paste it at the appropriate line in
itunes_plex.cfg
- if you're just starting with Plex and migrating from iTunes, start with the iTunes import scripts, then use playlist_sort.py if you wish (recommended)
These scripts are copyright © 2020 Arvid Rudling. Licensed under the 3-Clause BSD License, se LICENSE file
Plex is a trademark of Plex, Inc. or its subsidiaries. All other trademarks are the property of their respective owners.
The software is developed without any affiliation to the mentioned vendors.