Jump to content

python "client"


phillyfan1138
Go to solution Solved by Redshirt,

Recommended Posts

phillyfan1138

Hi all,

 

I would like to create a client in python that interacts with MBServer so that I can play movies on my Dune.  I have gotten fairly far in this endeavor by editing xbmcb3c's source code.  However, I am stuck in trying to convert the movie ID from MBServer to an actual path for my Dune to read.  I can easily find the path to the directory via "http://localhost:8096/mediabrowser/Users/e8837bc1ad67520e8cd2f629e3155721/Items?Fields=Path".  If I try to find the movie path using the following:

"http://localhost:8096/mediabrowser/Users/e8837bc1ad67520e8cd2f629e3155721/Items?ItemId=305d62a2790671abc87f1178d299ddb7&Fields=Path"  I just get the same result as using the original url.  If I do as the wiki suggests and try "http://localhost:8096/mediabrowser/Users/e8837bc1ad67520e8cd2f629e3155721/Items/305d62a2790671abc87f1178d299ddb7&Fields=Path" I get a "Null Reference Exception".  

 

I am sure I am really close and the solution is probably very simple, but I just can't seem to find any example of getting the url of a distinct movie.

 

Thanks!

Link to comment
Share on other sites

Cool stuff. Is this for personal use or do you plan or releasing it?

 

Path should be all you need - if it's a video file or iso it will point to the file path. If it's a folder rip it will point to the containing folder.

Link to comment
Share on other sites

phillyfan1138

Wow thanks for the quick reply! 

 

My personal vision for what I want to accomplish is probably very different from what others want.  I have always wanted a setup where I can scroll through my movies on an android or windows app, and choose a movie and have full two-way control with my Dune.  But I don't want to actually see any menus or "eye candy" on the TV, just the movie.  Therefore all I am creating is a python "client" that interprets commands from both MB and the Dune, essentially acting as a go-between.  There will be no GUI front end for the Dune or anything like that.  I would definitely make this available to others if I am satisfied with the stability and usability of the python "client", though I doubt there will be much demand for such a client.

 

Back to my original question:  I know that "path" should be all I need, but I can't seem to get any path more specific than the folder that contains my movies.  I have /Media1/Movies as my directory and then movies inside this directory like "2012/bdmv/index.bdmv".  All I need is to be able to get from the movie ID the path "/Media1/Movies/2012", but currently all I seem to be able to get is "/Media1/Movies". I am sure that I am missing something very obvious but this has stumped me.

Link to comment
Share on other sites

The id you are using must be for the containing media folder instead of the actual item you are trying to play.

Link to comment
Share on other sites

phillyfan1138

The id you are using must be for the containing media folder instead of the actual item you are trying to play.

I dont think so?  When I type this url:

 

 http://localhost:8096/mediabrowser/Users/e8837bc1ad67520e8cd2f629e3155721/Items?305d62a2790671abc87f1178d299ddb7&Fields=Path

 

I get the following returned:

 

Name:  Movies  Id:  45c1ccf7c03ea44831345916b03b764c  (note this is different from 305d62a2790671abc87f1178d299ddb7).  Path:  \Media1\Movies.  

 

305d62a2790671abc87f1178d299ddb7 is the Id for a movie that I see when I use "http://localhost:8096/mediabrowser/Users/e8837bc1ad67520e8cd2f629e3155721/Items?Recursive=true&IncludeItemTypes=Movie&field=Path"

Link to comment
Share on other sites

  • Solution
Redshirt

I don't use the /Items/{id} endpoint in my client so not sure how it works.

 

Instead I'd just use the /items endpoint. Check it out in swagger. You'd supply the ParentId as one of the arguments. Also Fields, UserId and any others you want.

Edited by Redshirt
  • Like 1
Link to comment
Share on other sites

phillyfan1138

I don't use the /Items/{id} endpoint in my client so not sure how it works.

 

Instead I'd just use the /items endpoint. Check it out in swagger. You'd supply the ParentId as one of the arguments. Also Fields, UserId and any others you want.

 

Much to my embarassment I had not seen swagger until you mentioned it.  That would have saved me a LOT of time and effort!  Swagger is a great feature!  Anyway, I have successfully figured out my issue:  Instead of "ItemIds=" the command is simply "Ids=".  So, as I suspected, it was a really easy fix.  Thanks for your help!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...