Probably a dumb question, but I couldn't find it in the developer API, is there a way to get the file location of a movie in plex?
For example, I would want to return this:
C:\Movies\StarWars\StarWars.avi
Probably a dumb question, but I couldn't find it in the developer API, is there a way to get the file location of a movie in plex?
For example, I would want to return this:
C:\Movies\StarWars\StarWars.avi
Yes and No. I was able to use the API to pull back the XML data for the Recently Viewed Shows.
I then used python to parse through the XML and get the all the files that were recently watched and remove them.
I'm not quite sure what your plans are for getting the file, but hopefully my code will be helpful to you.
Let me know if you have any questions:
The main portion of the code is the bottom sections the top parts of the code are just to make life simpler for configurations..
http://forums.plexapp.com/index.php/topic/84822-plex-auto-delete-script/
C:\Movies\StarWars\StarWars.avi
I do this in my small plug-in to find unmatched items:
https://github.com/ukdtom/Plex-FindUnmatched
/T
I was actually asking for the PlexConnect crowd... Someone implemented Trailers into PlexConnect, since for some awful reason Plex has not. That being said, it just uses themoviedb.org to get the trailer from there if they exist. I was asking them if they could do local trailer first, and my thought was something like:
if movie file found then
get file location moviename.*
does moviename-trailer.* file exist?
if moviename-trailer.* exists then
play this file
else
do themoviedb.org method
endif
endif
I didn't know if there was a way to get the file location through the API.
Nope. No file access like that. Plex needs to implement this in the scanner for it to be useful.
I was actually asking for the PlexConnect crowd... Someone implemented Trailers into PlexConnect, since for some awful reason Plex has not. That being said, it just uses themoviedb.org to get the trailer from there if they exist. I was asking them if they could do local trailer first, and my thought was something like:
if movie file found then
get file location moviename.*
does moviename-trailer.* file exist?
if moviename-trailer.* exists then
play this file
else
do themoviedb.org method
endif
endif
I didn't know if there was a way to get the file location through the API.
Nope. No file access like that. Plex needs to implement this in the scanner for it to be useful.
Actually, and without knowing PlexConnect in details, but as far as I know, it works by intercepting dns req.
So I fail to see why it also couldn't intercept a play command, and then via the API do other stuff.....
Problem however is though, that PlexConnect then would have to run on the PMS box itself, in order to get access to the file-system, or?
/T
Right. I’m just speaking of the plex API. I doubt though that plex connect would try and use something outside of the PMS API, but I could be wrong. I looked into this for the roku channel, and there were no options available, however as you said plex connect has more possibilities since it intercepts requests and could be run on the PMS allowing local file access.
The other issue… Even if you knew the path of the file, I’m not positive you could even play it. I don’t think you can just specify an local arbitrary file to play.
Actually, and without knowing PlexConnect in details, but as far as I know, it works by intercepting dns req.
So I fail to see why it also couldn't intercept a play command, and then via the API do other stuff.....
Problem however is though, that PlexConnect then would have to run on the PMS box itself, in order to get access to the file-system, or?
/T
The other issue.. Even if you knew the path of the file, I'm not positive you could even play it. I don't think you can just specify an local arbitrary file to play.
And here I think you are correct, IMHO
/Tommy
it twas worth a shot. :)
Just a thought:
If the "Trailers" feature you were talking about actually goes out and gets the location of the "web trailer" and stores it in an xml file somewhere..... When Plex Cycles through your media folders.... Then you could find that location and replace it based on a script, however if it only goes out and finds that link upon clicking that button, then no it would be much more difficult.
It finds the info on the fly. It’s not built into the PMS.
Just a thought:If the “Trailers” feature you were talking about actually goes out and gets the location of the “web trailer” and stores it in an xml file somewhere… When Plex Cycles through your media folders… Then you could find that location and replace it based on a script, however if it only goes out and finds that link upon clicking that button, then no it would be much more difficult.