[JSON API] add torrent JSONException

Suggestions and discussion of future versions
Post Reply
filippovma

[JSON API] add torrent JSONException

Post by filippovma »

I want add magnet link to deluge from java app. Please help me do it. I'm try do request:
url: http://127.0.0.1:8112/json
request body:

Code: Select all

 {"method":"web.add_torrents","params":[[{"path":"magnet:?xt=urn:btih:e9de6f415a109a7c8e7bc95dd68651e780fa7ef2","options":{"file_priorities":[],"add_paused":false,"compact_allocation":false,"download_location":"C:\Downloads","max_connections":-1,"max_download_speed":-1,"max_upload_slots":-1,"max_upload_speed":-1,"prioritize_first_last_pieces":false}}]],"id":2}
in console i see error:

Code: Select all

Traceback (most recent call last):
  File "deluge\ui\web\json_api.py", line 292, in render
  File "deluge\ui\web\json_api.py", line 256, in _on_json_request
  File "deluge\ui\web\json_api.py", line 207, in _handle_request
JSONException: JSON not decodable
How me resolve it problem?
Cas
Top Bloke
Top Bloke
Posts: 3681
Joined: Mon Dec 07, 2009 6:04 am
Location: Scotland

Re: API for add torrent.

Post by Cas »

filippovma wrote:JSONException: JSON not decodable
This error means that the it is not a valid json structure. In params there is a pair of square brackets that should be removed.

Edit: I re-tested this and the json structure is actually ok but I wonder if the windows path might be the issue as I have only tested this on linux.
Post Reply