Skip to content

Instantly share code, notes, and snippets.

@redperadot
Created January 29, 2014 17:43
Show Gist options
  • Select an option

  • Save redperadot/8693075 to your computer and use it in GitHub Desktop.

Select an option

Save redperadot/8693075 to your computer and use it in GitHub Desktop.
Export your plex library to the terminal.
#!/usr/bin/env bash
# redperadot@darkgem.net
# plex_list.sh
[[ $(uname) != "Darwin" ]] && echo "OS X Only" && exit 1
cd /Users/redperadot/Library/Application\ Support/Plex\ Media\ Server/Metadata/Movies
for file in $(find ./ -name '*.bundle'); do
file=$(echo "$file" | rev | cut -c 1- | rev)
title=$(cat "$file/Contents/com.plexapp.agents.localmedia/info.xml" | grep "<title>" | sed -e 's,.*<title>\([^<]*\)</title>.*,\1,g')
echo "$title"
done
cd /Users/redperadot/Library/Application\ Support/Plex\ Media\ Server/Metadata/TV\ Shows
for file in $(find ./ -name '*.bundle'); do
file=$(echo "$file" | rev | cut -c 1- | rev)
title=$(cat "$file/Contents/com.plexapp.agents.localmedia/info.xml" | grep "<title>" | sed -e 's,.*<title>\([^<]*\)</title>.*,\1,g')
echo "$title"
done
@redperadot

Copy link
Copy Markdown
Author

Quickly run with 'bash <(curl -fsSL https://gist.github.com/redperadot/8693075/raw/plex_list.sh)'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment