Problem with JSON-RPC Player.Open method in Frodo - does not recognise episodeid
#1
Hi, I am just doing some simple experiments with controlling XBMC via an external Python script. I am using the JSON-RPC and most commands are working as expected but there seems to be an issue with the Player.Open command when tying to play a TV episode from the library.

If I want to play a particular movie I use:

Quote:[{'jsonrpc': '2.0', 'params': {'item': {'movieid': 1271}}, 'method': 'Player.Open', 'id': 1}]

and I get the result

Quote:[{u'jsonrpc': u'2.0', u'id': 1, u'result': u'OK'}]

and the movie plays fine.

However if I want to play a particular episode I do:

Quote:[{'jsonrpc': '2.0', 'params': {'item': {'episodeid': 1271}}, 'method': 'Player.Open', 'id': 1}]

and get

Quote:[{u'jsonrpc': u'2.0', u'id': 1, u'error': {u'message': u'Invalid params.', u'code': -32602}}]

Why is this!! How do I make it play episodes from the library. I can play them using the file path with Player.Open but I want it to know its playing a library item and update the play count etc.

Thanks
Tom
Reply
#2
Probably a bug then. Will try to reproduce.
Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not e-mail Team Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply
#3
Thank you, I am using the latest official build (Frodo 12.2, May 2nd) on Windows.
Reply
#4
I tried it on yesterdays Nightly Build (20130917-92169a6-master) and got the same error with both "movieid" and "episodeid" !
Reply
#5
Back on the official build I get the same behaviour using Playlist.Add method

Quote:{"jsonrpc": "2.0", "params": {"item": {"episodeid": 1271}, "playlistid": 1}, "method": "Playlist.Add", "id": 1}

Gives

Quote:{
"jsonrpc": "2.0",
"id": 1,
"error": {
"message": "Invalid params.",
"code": -32602
}
}

But again it works fine with movieid! Hope that helps
Reply
#6
Player.Open and Playlist.Add use the same logic to try and find the file you would like to play so if it doesn't work on Player.Open, it won't work on Playlist.Add and vice versa.
Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not e-mail Team Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply
#7
Yea that makes sense! Were you able to reproduce the issue?
Reply
#8
Hi Guys, I am hoping someone can help me figure out a little with JSON parameters
I am trying to send a JSON command from my Home automation system to XBMC for control and I am having a little difficulty. The program sends web commands the same as Internet internet explorer would from the browser.

I have been searching the forum and trying to get eh commads right but apparently I am missing something I am trying to send the Player.Open command to allow me to select movies with voice recognition from my home automation system.

This is the format that I am sending

http://192.168.1.9:808/jsonrpc?request={"jsonrpc":"2.0","method":"player.open"{"item":{"movieid":437}}}

when I do so I get the following error
{"error":{"code":-32700,"message":"Parse error."},"id":null,"jsonrpc":"2.0"}

can some one help me figure this out

I am running XBMC FRODO 12.2

Thank you ken
Reply
#9
See
https://github.com/XBMC-Addons/service.s...ult.py#L52
For example.
You need to put the movieid inside params
Read/follow the forum rules.
For troubleshooting and bug reporting, read this first
Interested in seeing some YouTube videos about Kodi? Go here and subscribe
Reply
#10
Just tested Player.Open and Playlist.Add with "episodeid" on XBMC 12.2 and it works perfectly fine. Are you sure you are using an existing episodeid?
Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not e-mail Team Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply
#11
(2013-10-08, 07:01)Martijn Wrote: See
https://github.com/XBMC-Addons/service.s...ult.py#L52
For example.
You need to put the movieid inside params


I'm still confused and not getting it working could some one post how this command should look please

Thanks Ken
Reply
#12
Anyway to use the file names rather than movieid or away to list the movieID with the file names? any examples would be greatly appreciated.


anyway try this Ken,

//Play a single video from file. change everything in bold.
http://user:pass@xbmcIP:xbmcPort/jsonrpc?request={"jsonrpc":"2.0","id":"1","method":"Player.Open","params":{"item":{"file":"file:///C:/PATH/FILE"}}}
Reply
#13
HI!

i am having problems to start a streaming file (radio)
the file is storred in the music folder on my raspberry pi (openElec)

when i do this:

http://192.168.1.150/jsonrpc?request={"jsonrpc":"2.0","id":"1","method":"Player.Open","params":{"item":{"file":"file://storage/music/StudioBrussel.strm"}}}

it wont start, my xbmc says:

"Playback failed,
one or more items failed to play. check the log file for details."

(but i cant find any log file

can someone help me?
thanks!
Reply

Logout Mark Read Team Forum Stats Members Help
Problem with JSON-RPC Player.Open method in Frodo - does not recognise episodeid0