Kodi Community Forum

Full Version: Video Files with a White Space in filename causing parameter error
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

I'm trying to control my OpenELEC flavour of XBMC using the JSON RPC methods. I'm using the Google Chrome Simple REST Client to test. I have placed a photo and video file in the Media directory on my XBMC instance and this is available via SMB on the IP it's got \\192.168.0.170\Media

So far so good. Now I try to show the two items using the REST Client with:-
URL: http://192.168.0.170/jsonrpc
Header: Content-Type: application/json

Data: {"jsonrpc":"2.0","id":"1","method":"Player.Open","params":{"item":{"file":"/media/MyVideo.wmv"}}}
and also
Data: {"jsonrpc":"2.0","id":"1","method":"Player.Open","params":{"item":{"file":"/media/MyPhoto.JPG"}}}

Both of the above Data requests work fine, and come straight up on XBMC.

Now same experiment with spaces in title (I've renamed files in the Media folder by adding the space after "My")
Data: {"jsonrpc":"2.0","id":"1","method":"Player.Open","params":{"item":{"file":"/media/My Photo.JPG"}}}
The above works fine still.

Data: {"jsonrpc":"2.0","id":"1","method":"Player.Open","params":{"item":{"file":"/media/My Video.wmv"}}}
The above returns a parameter error.
{"error":{"code":-32602,"message":"Invalid params."},"id":"1","jsonrpc":"2.0"}

Any ideas? It's driving me crazy, also I've tried URL encoding the data, but hasn't helped.

Thanks
Dean Bennett
I don't know a thing about json, but can you tuck an extra set of single or double quotes on the .wmv file name param?

Code:
{"file";"'/media/My Video.wmv'"}

Just to see if it behaves any better?

BTW, posting this in a General support forum is probably not the best audience to get a solution for this type of material...
Thanks for the reply! I've tried that just and still same error message Sad

I'll try and post in a different section - thanks for the advice!
Hi,

I'm trying to control my OpenELEC flavour of XBMC using the JSON RPC methods. I'm using the Google Chrome Simple REST Client to test. I have placed a photo and video file in the Media directory on my XBMC instance and this is available via SMB on the IP it's got \\192.168.0.170\Media

So far so good. Now I try to show the two items using the REST Client with:-
URL: http://192.168.0.170/jsonrpc
Header: Content-Type: application/json

Data: {"jsonrpc":"2.0","id":"1","method":"Player.Open","params":{"item":{"file":"/media/MyVideo.wmv"}}}
and also
Data: {"jsonrpc":"2.0","id":"1","method":"Player.Open","params":{"item":{"file":"/media/MyPhoto.JPG"}}}

Both of the above Data requests work fine, and come straight up on XBMC.

Now same experiment with spaces in title (I've renamed files in the Media folder by adding the space after "My")
Data: {"jsonrpc":"2.0","id":"1","method":"Player.Open","params":{"item":{"file":"/media/My Photo.JPG"}}}
The above works fine still.

Data: {"jsonrpc":"2.0","id":"1","method":"Player.Open","params":{"item":{"file":"/media/My Video.wmv"}}}
The above returns a parameter error.
{"error":{"code":-32602,"message":"Invalid params."},"id":"1","jsonrpc":"2.0"}

Any ideas? It's driving me crazy, also I've tried URL encoding the data, but hasn't helped.

Thanks
Dean Bennett
Merged into JSON-RPC thread.
Thanks artafael ... sorry its my first time here so didn't spot dedicated developement and rpc topics! thanks for tidying up after me Smile
This "Invalid params" error usually means that the item you passed in doesn't exists. So in this specific case it can't seem to find the file/path you provide. Are you 100% sure that the path is correct?
you probably have to url-encode the whitespace character
(2013-11-15, 11:32)Montellese Wrote: [ -> ]This "Invalid params" error usually means that the item you passed in doesn't exists. So in this specific case it can't seem to find the file/path you provide. Are you 100% sure that the path is correct?

Thanks Montellese! You were right, I tried a completely different files with a white space already and worked fine! I wonder if the filenames had got cached or something for videos - as it obviously didn't pick up on the fact that i'd renamed "MyVideo.wmv" to "My Video.wmv" through the SMB share which I've accessed via Windows Explorer.

Much appreciated! Now I can crack on with more development

Thanks
Dean Bennett