File Not Found
#1
I'm trying to send a youtube video to openelec using rpc. My pi is responding to the following with file not found. When typing it in the browser, it says parse error. I don't see anything wrong. Do you?

http://192.168.1.133:80/jsonrpc?request={"jsonrpc":"2.0","id":1,"method":"Player.Open","params":{"item":{"file":"plugin://plugin.video.youtube/?action=play_video&videoid='EhSFtCfb5UQ'"}}}

What am I doing wrong?
Reply
#2
Any reason for the apostrophs around the videoid value? Where did you get this URL from?
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
I've tried it without the apostrophes, and if I remember, XBMC did not respond.

Are you asking about the entire URL, or the video id? The entire URL is what I've been seeing around the internet. The video id is from the url of some random youtube video.
Reply
#4
Can you please try to get an URL from XBMC by using the GUI to browse into the youtube plugin, go to a video and open the info dialog. Then read the URL from there and try with that. If that doesn't work either, something is odd. Otherwise something is wrong with your request.
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
#5
ALRIGHT!!!!

http://192.168.1.133:80/jsonrpc?request={"jsonrpc":"2.0","id":1,"method":"Player.Open","params":{"item":{"file":"plugin://plugin.video.youtube/?path=/root/video&action=play_video&videoid=EhSFtCfb5UQ"}}}

So the next (obvious) question is how to pause it. This gives me a 'failed to execute method' error:

http://192.168.1.133/jsonrpc?request={"jsonrpc":"2.0","method":"Player.PlayPause","params":{"playerid":0},"id":1}

edit - Nevermind. The video id is 1, not 0. Now it works. I think I got this now.
Reply
#6
So suddenly this does not work anymore. It is for every video, and also the other chrome extensions are not working. I think the extension is broken now.
Reply
#7
So the request still is not working, but the below does. I don't know what is wrong. I am trying to simplify things, and I would love to get the url version of the request working.

Code:
$.ajax({
     type: 'POST',
     dataType: 'json',
     contentType: "application/json",
     data: JSON.stringify(data),
     url: address
});

The JSON.stringify(data) line is:

Code:
{"jsonrpc":"2.0","id":1,"method":"Player.Open","params":{"item":{"file":"plugin://plugin.video.youtube/?path=/root/video&action=play_video&videoid=LqotPfMC-Mc"}}}

And the address value is:

Code:
http://192.168.1.3:80/jsonrpc?request={"jsonrpc":"2.0","id":1,"method":"Player.Open","params":{"item":{"file":"plugin://plugin.video.youtube/?path=/root/video&action=play_video&videoid=LqotPfMC-Mc"}}}

It seems to me that the ajax request is verbose, since the address should be enough to get the video playing all by itself. What is the difference between the ajax request and the url rpc request?
Reply
#8
Check xbmc.log with webserver debug logging enabled to see the difference in the two requests. I'm pretty sure that the ajax request will URL encode the JSON-RPC request.
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
#9
I think your right. I just tried it with encoding the request and the error is different. The response in the browser is 'okay', but the pi is showing a couldn't locate video url, which I think means the video id is getting changed during the encoding process. I'll keep trying.

Code:
http://192.168.1.3/jsonrpc?request=%7B%22jsonrpc%22%3A%222.0%22%2C%22id%22%3A1%2C%22method%22%3A%22Player.Open%22%2C%22params%22%3A%7B%22item%22%3A%7B%22file%22%3A%22plugin%3A%2F%2Fplugin.video.youtube%2F%3Fpath%3D%2Froot%2Fvideo%26action%3Dplay_video%26videoid%3D%203V7EugoweM4%22%7D%7D%7D
Reply
#10
According to this: http://wiki.xbmc.org/?title=JSON-RPC_API the request must be encoded like so:

Code:
http://<your-ip>:<your-port>/jsonrpc?request=<url-encoded-request>

Somehow I am back to a parse error. I wish it would give me a clue!

Code:
http://192.168.1.3:80/jsonrpc?request=%7B%22jsonrpc%22:%222.0%22,%22id%22:1,%22method%22:%22Player.Open%22,%22params%22:%7B%22item%22:%7B%22file%22:%22plugin://plugin.video.youtube/?path=/root/video&action=play_video&videoid=FqJdzYY_Fas%22%7D%7D%7D

Here it is unencoded:

Code:
http://192.168.1.3:80/jsonrpc?request={"jsonrpc":"2.0","id":1,"method":"Player.Open","params":{"item":{"file":"plugin://plugin.video.youtube/?path=/root/video&action=play_video&videoid=FqJdzYY_Fas"}}}




edit:

I GOT IT! The above is close, but I was using the wrong encoding. The correct JavaScript function for this is encodeURIComponent.
Reply

Logout Mark Read Team Forum Stats Members Help
File Not Found0