Kodi Community Forum

Full Version: JSON-RPC (Files.Download) Problems
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

I am working on an app for Windows Phone 8, and though I can get JSON-RPC working fine with other commands, the Files.Download option returns the following error.

{"error":{"code":-32601,"message":"Method not found."},"id":1,"jsonrpc":"2.0"}

This is the JSON command I am sending:
{"jsonrpc": "2.0", "method": "Files.Download", "id": 1, "params": {"path":"image://C%3a%5cUsers%5cjohndoe%5cDownloads%5cSabNZBd%5cMOvies%5cDeath%20Race%20Inferno%20(2012)%5cDeath%20Race%20Inferno%20(2012)%20%5b1080p-DTS-x264%5d.tbn/"}}

This is the response I am seeing in the XBMC.log file:

08:22:40 T:2176 DEBUG: webserver: request received for /jsonrpc
08:22:40 T:2176 DEBUG: JSONRPC: Incoming request: {"jsonrpc":"2.0","method":"Files.Download","id":1,"params":{"path":"image:\/\/C%3a%5cUsers%5cjohndoe%5cDownloads%5cSabNZBd%5cMOvies%5cDeath%20Race%20Inferno%20(2012)%5cDeath%20Race%20Inferno%20(2012)%20%5b1080p-DTS-x264%5d.tbn\/"}}
08:22:40 T:2176 DEBUG: JSONRPC: Calling files.download

I am currently using this version of XBMC
XBMC (12.0-RC3 Git:20130102-7a6cb7f), Platform: Windows 8 64-bit, build 9200. Built on Jan 3 2013 (compiler 1600)


Any help would be appreciated.

TIA.. :)
Files.Download is currently just a stub method for transports that support file downloads through JSON-RPC. None of the existing transports support it though. Over HTTP you can use Files.PrepareDownload to get a path that you can then call on your webserver to download the image using HTTP. Check http://wiki.xbmc.org/index.php?title=Web...e_.2Fimage for details on what URL to use to download an image from XBMC's webserver.
Ok, Thanks..
Any idea when it will become a supported?
The problem I have is that with authentication enabled on the XBMC webserver, through the web download interface I have available, I can not send authentication with the request.
I have tried using the inline method, ie: http://username:password@{Host Name/IP}:{port} , but it doesn't appear that XBMC webserver supports this method of authentication and I haven't found any docs on how to create a raw html request to do a download file request.
Perhaps changing the response from Unsupported Method to something more helpful? The API/v6 docs show this method.

Incidentally, I get the same result calling Files.PrepareDownload.
(2013-09-30, 18:03)doug316 Wrote: [ -> ]Perhaps changing the response from Unsupported Method to something more helpful? The API/v6 docs show this method.

Incidentally, I get the same result calling Files.PrepareDownload.

Why? The method is unsupported by that specific transport protocol. Files.PrepareDownload will only work over HTTP transport.
I'm suggested an error message per "not support on websocket transport" would be a useful response when applicable.