Working JSON RPC API Examples

  Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
petou Offline
Junior Member
Posts: 11
Joined: Jul 2016
Reputation: 0
Post: #136
Hello,


is anyone able to open a youtube video with JSON.

I passed several hours trying to get an example to work on my kodi (17.4) with no luck.

I would like to open it via plugin.video.youtube. If that could work i will try to do the same with my spotify addon!

thanks
find quote
Razze Offline
Team-Kodi Member
Posts: 1,640
Joined: Jan 2015
Reputation: 51
Location: Osnabrück, Germany
Post: #137
(2017-08-29 16:28)petou Wrote:  Hello,


is anyone able to open a youtube video with JSON.

I passed several hours trying to get an example to work on my kodi (17.4) with no luck.

I would like to open it via plugin.video.youtube. If that could work i will try to do the same with my spotify addon!

thanks

Well you can do this via the urls:
https://github.com/Razzeee/plugin.video..../plugin.py

Not sure if it's also possible via json rpc
find quote
MKANET Offline
Senior Member
Posts: 177
Joined: Mar 2015
Reputation: 4
Post: #138
Is there a command for to play next/previous media (Next/Previous during media playback)? I could only find the play/pause command.
find quote
petou Offline
Junior Member
Posts: 11
Joined: Jul 2016
Reputation: 0
Post: #139
@MKANET

Code:
{"jsonrpc":"2.0","method":"Player.GoTo","params":{"playerid":1,"to":"next"},"id":1}
{"jsonrpc":"2.0","method":"Player.GoTo","params":{"playerid":1,"to":"previous"},"id":1}  //had to tap 2 times to get previous song

I found the answer for my previous post. To play specific youtube video via youtube plugin:

Code:
{"jsonrpc":"2.0","method":"Player.Open","params":{"item":{"file":"plugin://plugin.video.youtube/play/?video_id=wQP9XZc2Y_c"}},"id":"1"}

videoid is in the video youtube address see : This link
(This post was last modified: 2017-09-09 13:09 by petou.)
find quote
MKANET Offline
Senior Member
Posts: 177
Joined: Mar 2015
Reputation: 4
Post: #140
Thanks petou.

It looks like the method Player.GoTo is isn't recognized; at least, on my installation of Kodi 17 on Windows.

Below, is the code that worked for me:

Code:
{ "jsonrpc": "2.0", "method": "Input.ExecuteAction", "params": { "action": "skipnext" }, "id": 1 }
{ "jsonrpc": "2.0", "method": "Input.ExecuteAction", "params": { "action": "skipprevious" }, "id": 1 }


(2017-09-09 13:06)petou Wrote:  @MKANET

Code:
{"jsonrpc":"2.0","method":"Player.GoTo","params":{"playerid":1,"to":"next"},"id":1}
{"jsonrpc":"2.0","method":"Player.GoTo","params":{"playerid":1,"to":"previous"},"id":1}  //had to tap 2 times to get previous song
find quote
petou Offline
Junior Member
Posts: 11
Joined: Jul 2016
Reputation: 0
Post: #141
Weird, it's the code i used for my kodi 17.4 on ubuntu... I'll try yours tomorrow.

Glad you found it!

edit: Just tried your method and it work as well.
(This post was last modified: 2017-09-10 16:16 by petou.)
find quote
Post Reply