Jake.codes

.plexignore DRM, for Plex

Tuesday, February 11, 2014

This shell script makes an educated guess at which files in your iTunes directories should be ignored because they are DRM’d and unplayable in Plex.

# TV Shows
cd "/Volumes/Life Boat/iTunes/iTunes Music/TV Shows";
mdfind "kind:movies codec:AVC0" -onlyin "/Volumes/Life Boat/iTunes/iTunes Music/TV Shows" | sed -e 's/\/Volumes\/Life Boat\/iTunes\/iTunes Music\/TV Shows\///' > .plexignore;
# Movies
cd "/Volumes/Life Boat/iTunes/iTunes Music/Movies";
mdfind "kind:movies codec:AVC0" -onlyin "/Volumes/Life Boat/iTunes/iTunes Music/Movies" | sed -e 's/\/Volumes\/Life Boat\/iTunes\/iTunes Music\/Movies\///' > .plexignore;
mdfind "kind:iTunes Extra" -onlyin "/Volumes/Life Boat/iTunes/iTunes Music/Movies" | sed -e 's/\/Volumes\/Life Boat\/iTunes\/iTunes Music\/Movies\///' | sed -e 's/$/\//' >> .plexignore;