HTTP API - File Not Found
#1
When trying to send commands to my Pi (OpenElec 2.99.2) via the http api interface, i'm getting.

File Not Found.

Webserver is on, port 8080 is defined in the command i'm sending, allow other systems to control is turned on...

Am i missing something basic?


(as background, i've created a small php page for the other half to use so she can see the latest movies i've added.. I'd like her to just be able to click on the poster and have it play..)
Reply
#2
HTTPAPI has been deprecated and is no longer available in Frodo. Use JSON-RPC instead.
Reply
#3
This is a script I use for playing files with JASON_RPC
Code:
#/bin/sh
# escape spaces
file=${1//\ /\%20}
curl -g localhost:8080/jsonrpc?request=\{\"jsonrpc\":\"2.0\",\"method\":\"Player.Open\",\"params\":\{\"item\":\{\"file\":\"$file\"\}\},\"id\":\"1\"\}
Change localhost to ip address of pi if on a different machine.
Reply
#4
Thanks guys, but i'm lost now Sad

basically i've written a small php page which queries the xbmc sql db based on simple search queries, then you click the poster and it gives you the trailer, movie info etc.. what i'd like to do is also have a button on the page which sends a command to my Pi to play that movie..

I have IDMovie value, or the direct file location available (or anything else really).. but i'm stuck as to how to send that as a POST or GET command from a form on a web page...

any ideas?
Reply
#5
(2013-02-14, 00:02)danmedhurst Wrote: Thanks guys, but i'm lost now Sad

basically i've written a small php page which queries the xbmc sql db based on simple search queries, then you click the poster and it gives you the trailer, movie info etc.. what i'd like to do is also have a button on the page which sends a command to my Pi to play that movie..

I have IDMovie value, or the direct file location available (or anything else really).. but i'm stuck as to how to send that as a POST or GET command from a form on a web page...

I've not tried anything like that. Have you been here?
http://wiki.xbmc.org/index.php?title=JSON-RPC_API/v6
Reply
#6
(2013-02-14, 00:33)popcornmix Wrote:
(2013-02-14, 00:02)danmedhurst Wrote: Thanks guys, but i'm lost now Sad

basically i've written a small php page which queries the xbmc sql db based on simple search queries, then you click the poster and it gives you the trailer, movie info etc.. what i'd like to do is also have a button on the page which sends a command to my Pi to play that movie..

I have IDMovie value, or the direct file location available (or anything else really).. but i'm stuck as to how to send that as a POST or GET command from a form on a web page...

I've not tried anything like that. Have you been here?
http://wiki.xbmc.org/index.php?title=JSON-RPC_API/v6

Yeah i've gone through that.. just doesn't make much sense to me Sad What i need is an example of how one command is sent to XBMC via GET or POST.. i should be able to figure it out from there...
Reply
#7
(2013-02-14, 01:06)danmedhurst Wrote: Yeah i've gone through that.. just doesn't make much sense to me Sad What i need is an example of how one command is sent to XBMC via GET or POST.. i should be able to figure it out from there...

Using my example with "-v" flag to curl shows what is sent:
Code:
> GET /jsonrpc?request={"jsonrpc":"2.0","method":"Player.Open","params":{"item":{"file":"mnt/Prometheus.Sample.mkv"}},"id":"1"} HTTP/1.1
> User-Agent: curl/7.26.0
> Host: localhost:8080
> Accept: */*
>
Reply
#8
Ok i'm getting somewhere.. the below will pause or play the currently playing video :

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

So i guess i just have to work out the "request" portion to tell it to play a movie i select.
Reply
#9
Having issues getting the Player.Open method to work.. can you see what i'm doing wrong?

http://192.168.1.66:8080/jsonrpc?request={"jsonrpc": "2.0", "method": "Player.Open", "params": {"item": { "movieid": 1 }}, "id": 1}

EDIT : The below works Smile

http://192.168.1.66:8080/jsonrpc?request={ "jsonrpc": "2.0", "method": "Player.Open", "params": { "item": { "file": "smb://serveur/movie/movie.mkv" } }, "id": 1 }
Reply

Logout Mark Read Team Forum Stats Members Help
HTTP API - File Not Found0