Retrieve media list via HTTPapi

I am trying to retrieve a list of movies, music artist and tv shows in the library of Plex using the HTTP API. The only way I see of doing this is to ask for the sources of each media type (movies, photos, music, etc.) Then, ask for the file contents of each source, which would then have to be parsed, and then checked for subdirectories, and parsed, and so on.



Is there an easier way to do this?



Sounds like you're trying to get a database dump out and the API is designed for interactivity. In looking at the API (http://xbmc.org/wiki/?title=WebServerHTTP-API) I'd say the answer is 'not using their api'.

Why not just copy off the databases if you want to do that, or write something to dump them out?

/Users//Library/Application Support/Plex/userdata/Database/

They're SQLite3 so it should be pretty simple.

You could just symlink them out of your webserver directory for Plex.

/Applications/Plex.app/Contents/Resources/Plex/web/

If you're feeling ambitious you could always write a sqlite3->xml converter. I found a couple but nothing command line that you could stuff into a CGI.

-n

Lets pretend I dont understand a word you said (and I dont), and the only interface to Plex I have is the HTTPAPI. I want to retrieve the list of items Plex has under its library.



I have tried retrieving the directory listing, and obviously all I am gonna get is the sometimes incoherent filenames. How can I get the library contents via the HTTPAPI?

Okay, so I am able to read and display the media list in the tableview. I have used the SQLiteBooks example provided by Apple as an example how to read an parse the SQLite database. The problem is I get a list of 340 albums with the same name as the first. I suppose that the pk is not auto-incrementing. How should the following code be implemetented?


if (sqlite3_prepare_v2(database, sql, -1, &statement, NULL) == SQLITE_OK){<br />
			while (sqlite3_step(statement) == SQLITE_ROW){<br />
				int primaryKey = sqlite3_column_int(statement, 0);<br />
				Media *msc = [[Media alloc] initWithPrimaryKey:primaryKey database];<br />
				[artists addObject:msc];<br />
				[msc release];<br />
			}<br />
		}


Thanks in adavance.

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