How to Export a List of Plex Movie Files

Sometimes you just want a list of your content in a text file

Plex has a really nice interface for looking through your content. Its got nice images and displays everything in a pleasing way. But sometimes you just need a simple list of all your content. Let's learn how to get that.

Creating a Text File of All Plex Movies (Linux-based Plex Server)

If you have a linux-based Plex server, like a Raspberry Pi, here are the steps to get your file list. Because of Plex' permission systems, its difficult to do this from a normal user. I'd recommend just doing it a root to make things easy. This will make you the root user:


sudo -i

Once you are root, the next step is to find a program called "Plex Media Scanner." On the Raspberry Pi it is located at "/usr/lib/plexmediaserver/Plex Media Scanner". If its not there on your system you can runner this command to find it:


find / -name "Plex Media Scanner"

Next we need to tell the scanner where to find Plex related stuff. On Debian, Fedora, Cent OS, Ubuntu, and Raspberry Pi OS, the directory we need is at "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/". If you are using a different system you can find where you data directory is on Plex' website. Once you have it export it so the scanner knows where to look (Enter the data directory for your system if it is different):


export PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR="/var/lib/plexmediaserver/Library/Application Support"

Now we are ready to run the scanner. Since the program is not in our PATH, we will run it with the full path we found above:


/usr/lib/plexmediaserver/Plex\ Media\ Scanner --list

This command will print out a list of your Libraries and assign each a number. You should see something like this for example:


1: Movies   
2: TV Shows  

If you are trying to list your Movies, note the number that appears next to "Movies". In the example it would be "1". Now use that number in the next command for the "--section" argument.


/usr/lib/plexmediaserver/Plex\ Media\ Scanner --list -section [library number you want]

This will print out all movies in that library. If you want to output them to a text file you can do that like this:


/usr/lib/plexmediaserver/Plex\ Media\ Scanner --list -section [library number you want] > movielist.txt

Creating a Text File of All Plex Movies (Windows-based Plex Server)

You can follow the same general idea for a Windows-based server, with a few small changes. First you should open a command line and change to your Plex installation directory. On most systems this will be "C:\Program Files (x86)\Plex\Plex Media Server". Once you are in that directory you should be able to run the scanner:


"Plex Media Scanner.exe" --list

Similar to above this command will print out a list of your Libraries and assign each a number. You should see something like this for example:


1: Movies   
2: TV Shows  

Note the number that appears next to "Movies" or whatever Library you want to list. In the example Movies would be "1". Now use that number in the next command for the "--section" argument.


"Plex Media Scanner.exe" --list -section [library number you want]

Instead of printing to the terminal, you can print to a file like this:


"Plex Media Scanner.exe" --list -section [library number you want] > movielist.txt

Just make sure you write a file somewhere where you have permission to do so or else you might get a "permission denied".

Creating a Spreadsheet of All Plex Movies (Linux-based Plex Server)

As a bonus for Linux users, we have created a simple python script that will export your movies as a csv file which can be viewed in any spreadsheet type program similar to Excel. You can get the script at our github page. You don't need to set up any of the enviromental variables or play with any PATHs to use it. You also shouldn't need any superuser permissions.

Once you grab the script from us, you can use it like this:


plexlist.py -o [outputfile.csv]

It will look through your Plex database, find all your libraries, and ask which one you want to list. Once you choose a library, it will output a csv file will a bunch of info about each title in the library.