Http access to Plex Media server

description of how to access Mediaserver databases via http
All,

Does anybody know how I can access the music and video databases as used by the Plex Media server?
The current http api only foresees access to the xbmc databases. It works but I would prefer to use the databases of the Plex Media server. Especially as Plex is departing from support of the xbmc database ??! .. looking to the "Now Playing" option which only works for music selected from iTunes (read Plex Media server), all music selected from the 'old' 'xbmc' database just shows a grey screen........

Thanks already for your reply.

Rgds

PS starting to play a file using http api generates an error .. but stills starts to play the file ;-)

The media server accepts standard HTTP requests, and responds with either XML directory listings or actual content. Simply use Firefox (or a HTTP client that displays the XML - Safari doesn’t do this) and hit http://localhost:32400, and you should start getting directory lists back. The “key” attribute of the items specifies which path to go to next, e.g. http://localhost:32400/music, http://localhost:32400/music/iTunes, etc.

EXCELLENT!



I was looking for this!.. it does mean I have to fully rewrite my processing and query process on the Pronto but this is what I needed!!



Thanks again!

Is there anyway to get/set the current position that the file is at? I am writing a set of tools to keep my iTunes library in sync with my Plex library. I am using itunes.py to handle the iTunes end of things. I have successfully removed deleted items from the iTunes library and will use this info for marking items as watched/unwatched; but I think it would be great if I started watching a video in Plex on my laptop, and then finished in iTunes on my mac mini hooked to my tv.




The only way to write data back into the plex database is by using SQLite and modifying the database directly if you want to know more see my post here: http://forums.plexapp.com/index.php/topic/33378-plex-database-access/page__view__findpost__p__213611 the API as is now only lets you read the DB since all the API does is display the DB in XML format

This isn’t true. The web-based media manager uses the HTTP API to make all modifications to the database, and the clients send back modifications to view count & offset etc. I suggest you watch the logs while using these features to see how it’s done. We do not recommend modifying the database directly - none of our apps do :slight_smile:


Is there some documentation anywhere for the XML API? Asking developers to reverse engineer from the logs is a very poor documentation strategy, for example, I am interested in how to mark an item watched/unwatched so I played it and then examined the logs and found this:



<br />
Nov 30, 2011 09:58:22 [14708] DEBUG - Request: GET /:/scrobble?key=161&identifier=com.plexapp.plugins.library [127.0.0.1] (1 live)<br />
Nov 30, 2011 09:58:22 [14708] DEBUG -  * key => 161<br />
Nov 30, 2011 09:58:22 [14708] DEBUG -  * identifier => com.plexapp.plugins.library<br />
Nov 30, 2011 09:58:22 [14708] DEBUG - Library item 161 'The Kingsroad' got played!<br />





Is this how an item gets marked as watched? What does scrobble stand for? Is it possible to mark it as unwacthed?

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.