Remote Python JSON help needed
#16
This is what I use to pull all the movies:
Code:
{"jsonrpc":"2.0","method":"VideoLibrary.GetMovies","params":{"filter":{"field":"playcount","operator":"is","value":"0"},"limits":{"start":0,"end":25},"properties":["thumbnail","file","path"],"sort":{"order":"ascending","method":"label","ignorearticle":true}},"id":"libMovies"}'

This is what I'm using to play the movie:
Code:
{"jsonrpc":"2.0","method":"player.open","params":{"item":{"movieid":movieToPlay}},"id":"libMovies"}

The pull URL is just pulling from 0 to 25 for testing. I would like to limit this URL to a specific library
The play URL is just using whatever ID i'm selecting from the pull list.

I'm still trying to figure out how the JSON syntax works. Thanks for bearing with me.
Reply
#17
You can combine multiple filters in one request. Will send an example later.
BBC Live Football Scores: Football scores notifications service.
script.squeezeinfo: shows what's playing on your Logitech Media Server
Reply
#18
Ok, to do two filters e.g. 0 playcount and restrict path, try this:
Code:
{"jsonrpc":"2.0","method":"VideoLibrary.GetMovies","params":{"filter":{"and":[{"field":"playcount","operator":"is","value":"0"},{"field": "path", "operator": "contains", "value": "/path/to/your/movie/folder"}]},"limits":{"start":0,"end":25},"properties":["thumbnail","file","path"],"sort":{"order":"ascending","method":"label","ignorearticle":true}},"id":"libMovies"}

Note the use of the "and" method in the filter section.
BBC Live Football Scores: Football scores notifications service.
script.squeezeinfo: shows what's playing on your Logitech Media Server
Reply
#19
I figured it out. I had a eureka moment this morning. I'm grabbing the "file" field when I pull the list of movies so I could use that for the play URL:
Code:
{"jsonrpc":"2.0","method":"player.open","params":{"item":{"file":movieList[movieToPlay-1]["file"]}}}

I'll post my final code when I have it completed.
Reply
#20
good you've got it working, but the movieid should work fine too - I've used it in my own code before!
BBC Live Football Scores: Football scores notifications service.
script.squeezeinfo: shows what's playing on your Logitech Media Server
Reply
#21
Someone knows how to send command from a python script to kodi like kore or Yatse does via JSON?

Specifically I'm searching the command to start a particular plugin or to start a particular video on url.
Reply

Logout Mark Read Team Forum Stats Members Help
Remote Python JSON help needed0