Plex Web Export

So I think I figured out my own problem. After not getting rsync to work I went right to Dropbox. Then left it running as I tried everything else. I think it somehow locks files in its sync folders. As soon as I quit Dropbox on my web server everything started working. I’ll stick with Cyberduck for now.

This is exactly what I had been looking for. Thanks a bunch! :slight_smile:

Hi again.



I downloaded the archive, left it in my Downloads folder and ran the script. It executed perfectly and scanned everything. I then renamed the parent folder “Plex” and copied it to my Dropbox public folder, pointed my subdomain name to it and it was working great. All the movies and television shows were listed.



Later, I made some changes to my library and ran the script again from within the Plex folder in my Dropbox public folder and it gave me the following error:



14:44:36 Searching for sections in the Plex library at http://localhost:32400/<br />
14:44:36 Found 2 sections in this Plex library<br />
14:44:36 Scanning section: Movies<br />
14:44:36 Error: Data could not be read from the Plex server at http://localhost:32400/library/sections/2/all<br />
14:44:36 Error: No items were added for Movies, skipping<br />
14:44:36 Scanning section: TV Shows<br />
14:44:36 Found 63 shows in TV Shows



I made a copy of the Plex folder in my Downloads folder and ran the script from there and it shows the same error there as well. If you now [go to my library](http://library.aayush.me), it does not list my movies any longer.

Help?

@aryayush Very odd. As a quick test can you please try going to http://localhost:32400/library/sections/2/all and seeing what’s shown (if you just see a blank page, try going View Source).

Thank you for the quick reply. Figured it out after your hint. That page was displaying the following error:



This page contains the following errors:<br />
<br />
error on line 968 at column 908: invalid character in attribute value<br />
<br />
Below is a rendering of the page up to the first error.



I went to the source and found a series of inverted question marks in line 968 in a movie’s tagline. Went into the Media Manager and the characters weren’t visible there, so I removed it and typed it by hand. Ran the script again and it worked without any issues.

Thanks for your assistance. :)

@aryayush Happy to have helped :slight_smile:

I do have a couple of feature requests though:


  1. Please add a Recently Added playlist to the sidebar, so people who visit your library regularly (maybe no one will, but hey, optimism never killed anyone) can check out the new stuff you have added since they last visited. Kidding aside, this would actually be the perfect solution for me. A couple of my friends regularly come over to my house so we can watch something together and it’d make my life so much easier if they could use this online library to make up their minds about what they want to watch before they came over.


  2. Maybe this is hard to implement and will cause the search feature to lose its instantaneousness, but you should search all the metadata instead of just the titles of shows. Searching for “batman” should show both Batman Begins and The Dark Knight and searching for “bale” should list all of Christian Bale’s movies.

@aryayush Check out the v2 branch on GitHub (https://github.com/Dachande663/Plex-Export/tree/v2) which offers the first feature. I am looking at improving the search feature as well so it’s similar to Plex itself, searching across multiple sections etc.

Holy cow, did someone ever tell you that you are awesome?



I can see that this is a work in progress but I cannot wait for you to improve upon this and put out the final release.



Two questions:


  1. How do I automate the running of this script?


  2. How do I get the script (which is in my Documents folder) to export to a folder called “Plex” (instead of “export”) in my Dropbox public folder?

@aryayush it’s very much a work in progress, so feature requests etc are more than welcome!


  1. Others in this thread have discussed the best ways on how to automate it, either through launchd or basic cron jobs etc. Your best bet is to read through the thread and see what works best for you.


  2. There is an output-dir argument e.g. cli.php -output-dir=/users/aryayush/documents/my-plex-export

I got the following error when I tried that:



-bash: cli.php: command not found



This is the command I had entered (once I was in the right directory):


cli.php -output-dir=/Users/Aayush/Dropbox/Public/Plex



What’d I do wrong?

How were you running it before? cli.php must be a valid path e.g. /Users/Aayush/Downloads/plex-export-1234/cli.php -output-dir=/Users/Aayush/Dropbox/Public/Plex

Strange. I must be missing something but I cannot figure out what. I have already opened Terminal in the folder that ‘cli.php’ is in, as I was doing before, so I cannot think of any reason why it shouldn’t work.



And yet, that must be where the mistake is because it did work when I tried it with the full path of the file. I’ll figure it out.



Thank you for all the assistance.

You need to run ‘./cli.php …’ - i.e. adding a dot and a slash.

That worked. Thank you. :slight_smile:

hey,

i have a problem.

I’m running the PMServer on my Windows HomeServer (intel Atom ^^). The Server has the local ip 192.168.1.3

so i want to run your cli.php script on my imac and edit the parameter for a different machine.



i cd into the right directory and enter the following command:



php cli.php -plex-url=192.168.1.3:32400



i just get an error, that plex export cant find any PlexMediaServer



what should i do??

thanks for your help!



Greetings

Hi bam2000, first quick test: On your iMac, open http://192.168.1.3:32400 in Safari or similar and see what output you get (if you just see a blank page, View Source).

yes i get an white/blank page… here the source code of this website:




<?xml version="1.0" encoding="UTF-8"?>























solved… i dont write http:// the first time, with http:// everything works fine and is scanning my media Library. Thank you :smiley:

Next questions then:

[list=1]

[]Are you using the older Plex Export or the new v2?

[
]Do you have authentication enabled on PMS?

[/list]



Also, try php cli.php -plex-url=http://192.168.1.3:32400/ to see if it’s a weird formatting bug :confused:



EDIT: Good to hear! I think the older version wasn’t as nice, this shouldn’t happen with v2 :slight_smile: