How to extract a list of your Plex Movies or TV Shows

I wanted to make a list of my owned movies in Excel (for reasons we’ll not bother going into now) so after much Googling I managed to find a way to pull a list from Plex from here, documenting it here so that I can come back to it later if I need to.

Using Plex’s built in command line commands…

In Windows… 

Open command prompt in Plex Media Server folder and use following command to get a list of your ‘sections’:

"Plex Media Scanner.exe" --list

Then run the following command using the section number of your Movies, or TV, or whatever you want to export:

"Plex Media Scanner.exe" --list --section 1 > Movie_List.txt

 

Note: For Linux systems the commands are very similar but you need to define the library path as an environment variable for each session:

export LD_LIBRARY_PATH=/usr/lib/plexmediaserver

Then the command arguments are the same but the path is different. e.g.

/usr/lib/plexmediaserver/Plex\ Media\ Scanner --refresh --force --item 42

The built in tools export a simple list of all movie titles in your library. Unfortunately I need to be able to filter on ‘watched’ so this didn’t help too much.

Plex Export

Maintained on github here: https://github.com/Dachande663/Plex-Export

I really liked this one since you don’t even need to run it on the same machine as your Plex server. My Plex server is on my HTPC but I also have a Ubuntu based NAS in the house which I use for various things including a webserver so it is perfect of hosting this script (note, you don’t need a webserver to run this script). You do need to have php installed on whatever system you are running Plex Export on though.

Before viewing the exported library you need to run the export script, just run this from a command line:

php cli.php -plex-url=http://other-machine.local:32400

You can leave out the -plex-url argument if the script is being run on the same machine as your library. You can actually edit the cli.php file and permanently change the url if you want.

Then open the index.html file to view your library export. It’s a pretty cool way of viewing your library but again it doesn’t help me with getting a nice text export that includes details on watched/unwatched. Here is a pic of my unwatched items taken from Plex Export, I think it’s a pretty cool way of displaying your collection…

Let’s try something else…

Plex2CSV

Details on the Plex forum here and its github page here. I would actually advise installing from the ‘Unsupported Appstore v2’ which you can find out about here. Installing the Appstore is really simple, just download the Webtools github files which are linked on the Appstore forum post, put them in your Plex plugins folder, then restart Plex Media Server. Then go to http://<plex server IP>:33400/ and enter your Plex username/passwor

Once you’ve installed WebTools to get the Unsupported Appstore, enter the Plex2CSV github url in the appstore installation box, or you might find it in the list below the text box:

Once Plex2CSV is installed go and find it in your channels list in Plex. Click on the settings icon and set the output directory, if you don’t set this then you can’t export playlists only whole sections in their entirety. You can also change the level of detail to be exported but I haven’t played with this yet.

I then made a playlist of my unwatched movies by going to the Movies section, filter on unwatched, then click on add to playlist. Go back to the Plex2CSV channel and export the new playlist. This is what I got…

Perfect!

It’s also worth playing with the settings again and changing the level of detail to see what other details you can export.

 

1 Comment

  1. Installed php per instructions elsewhere.

    Running php cli.php {etc} returns:

    Could not open input file: cli.php

    I must be missing something…

Leave a Reply

(email optional)


Warning: Undefined array key "rerror" in /home/public/blog/wp-content/plugins/wp-recaptcha/recaptcha.php on line 291