JSON command to start youtube video

I tried posting this in the Kodi forums but no replies.

​I’m trying to get to fire up a youtube video by sending a URL to my kodi box. I put together info from a few resources and constructed the following command to issue from a browser but I’m getting an error. Can someone help correct it please?'{"jsonrpc":"2.0","id":"1","method":"Player.Open","params":{"item":{"file":"plugin://plugin.video.youtube/action=play_video&videoid='szjaHbjhauk'"}}}

But I’m getting the error

{“error”:{“code”:-32700,“message”:“Parse error.”},“id”:null,“jsonrpc”:“2.0”}​

I’m using curl like this

curl -s -H 'Content-Type: application/json' -d '{"jsonrpc": "2.0", "method": "Player.Open", "params": {"item": { "file" : "plugin://plugin.video.youtube/play/?video_id=mNF9eMOuSUk"}}, "id": 1}'

I tried to adjust the variables in your command and constructed{"jsonrpc": "2.0", "method": "Player.Open", "params": {"item": { "file" : "plugin://plugin.video.youtube/play/?video_id=mNF9eMOuSUk"}}, "id": 1}

However I get the error

{"error":{"code":-32099,"message":"Bad client permission."},"id":1,"jsonrpc":"2.0"}

I have disabled the authentication for web interface in kodi.

Any suggestions? Highly thankful.

Looking at that I’m guessing you are trying that directly in your browsers address bar. That’s a POST command and I’m pretty sure you can’t send POST commands to Kodi via http from a browser.

Yep, here you go, this thread explains it:- Changes to the JSON API for Kodi Leia


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