Export library to text/html format?

Is it possible to get a plain list of all media stored in the library. It would be good to bring on sales etc to not double-but things which I tend to do.





I haven’t seen such a feature so perhaps this post should be moved to the feature request area.

No, it’s not possible. I think you can export to XML but that’s it. I suppose you could use some other reporting tool on the SQLite databases, but apart from that I don’t have any ideas, sorry. :slight_smile: It probably would count as a feature request, but since we’re not extending the current library at all I doubt you’ll see it added any time soon.




Makes sense. I guess writing an XSL matching the XML would do the stuff for me. I'll see what I can do.


Maybe you want to look at this applescript.

[codebox]-- requires SQLiteAddOn (http://www.sqlabs.net/sqliteaddons.php) doesn't require registration in our case
-- will iterate the DB to get the titles from the movies table and put in a TextEdit document (that can be edited/saved)
-- EDIT 6 LINES BELOW TO THE PROPER USER NAME

property queryRef : 0
property s : ""

-- SET THE PATH TO THE DB INTO YOUR DESKTOP
set dbName to "/Users/USERNAME/Library/Application Support/Plex/userdata/Database/MyVideos34.db"

-- OPEN your sqlite 3 database
SQLiteOpen dbName
-- EXECUTE QUERY, result is an array
set queryRef to SQLiteSelect dbName query "SELECT count(idMovie) FROM movie"
set myValue to SQLiteGetRow queryRef row 1
set numberOfMovies to item 1 of myValue
-- FREE QUERY

SQLiteFree queryRef

set myMoviesList to ""
repeat with myrecord from 0 to (numberOfMovies - 1)
set queryRef to SQLiteSelect dbName query "SELECT c00 FROM movie LIMIT " & myrecord & " ,1"
set myValue to SQLiteGetRow queryRef row 1
set myResult to item 1 of myValue
SQLiteFree queryRef
set myMoviesList to myMoviesList & myResult & return

end repeat
SQLiteClose dbName


tell application "TextEdit"
activate
make new document
set text of document 1 to myMoviesList as text
end tell
[/codebox]



Is someone able to write a example applescript without using a 3rd party addon?
The link in the script to download SQLiteAddOn is dead, and at the new site it is gone.
Would be nice to have such a applescript which runs without dependencies.

Erwin

Any update on this?



I would also like to have a text document of the movies in my “Movies” section and my “watch videos” section. Right now I am dealing with movies showing up in my videos section but not in my movies… with 800+ movies I am having a hard time trying to figure out which are missing…



I would live it if this feature could be added!



Besides that I love plex more than any other program i have ever seen!



I could whip something up in python using templates I guess, is there still a demand for this?

I have been trying to figure out a way to get a text export also, so I'd appreciate a solution. Users often keep a database of their movies, so exporting from Plex would be desirable.

In addition, the ability to export artwork would also be nice.

I’m partway through writing a script that does exactly this. At the moment, all that it does is list the movies and the TV shows; I still need to add functionality to list which seasons (and how many episodes per season) and also to deal with non-ASCII characters in the names.



I can post it now if people are impatient, or I can post an updated version in a few days when it’s a bit more polished.

Okay, it’s done. A Plex exporter, cunningly called plexport, which exports your library to a plain text list.



Unzip the attached into ~/Library/Application Support/Plex/scripts/ (~/Library means the library folder in your home folder). Be sure that the folder is included - so you end up with ~/Library/Application Support/Plex/scripts/plexport/default.py



You can now use it by going to Plex’s scripts. On the standard (MediaStream) skin, you go to “Change your Preferences”, hit right, and select “Scripts” from the menu; in the Aeon skin, just select “Scripts” from the main menu. Then hit “plexport”



It will run for a few moments (it might be quite a few moments on a large library, so have patience!) and you’ll then find a file called plexport.txt on your desktop which contains a list of all movies and TV shows; for TV shows, the seasons and number of episodes for that season are also listed.



This comes with one warning though - if by some coincidence you already have a file called plexport.txt on your desktop, it will overwrite it without asking. So just check before running it!



Hope it’s as useful to others as it is to me.



[EDIT] Updated version available, please scroll down! (how do I remove an attachment from my post?)

Wow - Thanks for the great script! It works like a charm and is exactly what I have been looking for. :smiley:

Awesome. Someone should sticky this. Very handy.

thanks for this!!

I’ve had a couple of bug reports.


  1. It doesn’t order seasons correctly if you have seasons higher than ten (like The Simpsons). It uses a naive sorting order so you might get something like 1, 10, 12, 15, 2, 20, 3, 4.


  2. If you have a show with an apostrophe in it, then it never shows the seasons or episode counts for that show.



    Just thought I ought to make people aware of these; I will post a fix up here when I’ve put some time aside to have another mess about. I know what’s causing both issues, so that’s half the work done already :slight_smile:



    I’m glad people are finding this useful!

Just out of curiousity, is there much interest in me making this output HTML as well/instead of plain text?



I’m not promising anything, just wondering…




Zoara, it would be just GREAT to have an HTML export of the library... if you can spare some time to try that would be terrific :P

Quick bugfix update, attached at the bottom of this post.



Seasons will now display in the correct order, for example it used to order them “1”, “10”, “2”.



Shows containing an apostrophe now correctly display their seasons and episodes.



Same installations instructions as detailed in the post above.





This is now planned. :)
However, just as I was about to start working on it, a family member phoned up with computer problems, so it probably won't be done today. <_< But it will happen, I promise!


.

I too am very happy to see this script and I appreciate the work that went into it not knowing how to create scripts myself.

I hate to ask this since I know it must take time but could you also include Music Videos in this script, thanks.

This is just great! Thanks!!!

Works great!! THX!