Re: Android, Remote Only Client
Posted: Tue Sep 01, 2009 11:05 pm
Ah sorry, I gave you the wrong method, it's auth.login, must've been having a sleepy moment. Apologies.
Support Forum for the Deluge BitTorrent Client
https://forum.deluge-torrent.org/
Code: Select all
{"id": 1, "result": true, "error": null}
Code: Select all
Transfer-Encoding: chunked,
Date: Wed, 02 Sep 2009 12:02:59 GMT,
Content-Type: application/x-json,
Server: TwistedWeb/8.2.0,
Set-Cookie: _session_id=ccc63c79be099e69279f3418fe9f6bc52324; Expires=Wed, 02 Sep 2009 13:02:59 UTC; Path=/json
Code: Select all
Invalid cookie header: "Set-Cookie: _session_id=7f85f51a950d854df35fd07a620dd0d62248; Expires=Wed, 02 Sep 2009 13:42:13 UTC; Path=/json". Unable to parse expires attribute: Wed, 02 Sep 2009 13:42:13 UTC
Code: Select all
Set-Cookie: _session_id=ee26b4ae24a71aae5935a47f3ba80f222324; Expires=Thu, 03 Sep 2009 10:08:24 GMT; Path=/json
Code: Select all
{"method":"core.remove_torrent","params":[["60d5d82328b4547511fdeac9bf4d0112daa0ce00"],false],"id":2}
Code: Select all
[ERROR ] 11:24:11 client:375 RPCError Message Received!
--------------------------------------------------------------------------------
RPCRequest: core.remove_torrent([u'60d5d82328b4547511fdeac9bf4d0112daa0ce00'], False)
--------------------------------------------------------------------------------
File "/usr/local/lib/python2.6/dist-packages/deluge-1.2.0_dev-py2.6.egg/deluge/core/rpcserver.py", line 281, in dispatch
ret = self.factory.methods[method](*args, **kwargs)
File "/usr/local/lib/python2.6/dist-packages/deluge-1.2.0_dev-py2.6.egg/deluge/core/core.py", line 288, in remove_torrent
return self.torrentmanager.remove(torrent_id, remove_data)
File "/usr/local/lib/python2.6/dist-packages/deluge-1.2.0_dev-py2.6.egg/deluge/core/torrentmanager.py", line 479, in remove
raise InvalidTorrentError("torrent_id not in session")
InvalidTorrentError: torrent_id not in session
Code: Select all
{"id":2,"method":"core.set_config","params":[[{"max_upload_speed":2},{"max_download_speed":1}]]}
Code: Select all
[ERROR ] 10:29:02 client:375 RPCError Message Received!
--------------------------------------------------------------------------------
RPCRequest: core.set_config([{u'max_upload_speed': 2}, {u'max_download_speed': 1}])
--------------------------------------------------------------------------------
File "/usr/local/lib/python2.6/dist-packages/deluge-1.3.0_dev-py2.6.egg/deluge/core/rpcserver.py", line 281, in dispatch
ret = self.factory.methods[method](*args, **kwargs)
File "/usr/local/lib/python2.6/dist-packages/deluge-1.3.0_dev-py2.6.egg/deluge/core/core.py", line 478, in set_config
for key in config.keys():
AttributeError: 'tuple' object has no attribute 'keys'
You've got one too many [] around the params, should be params: [{.....}], not params: [[{....}]]ElmoTheElk wrote:Back again with another question!
I am implementing support in my Android app to allow user to set the maximum transfer rates (download and upload). Here is the JSON request I am sending to Deluge:But then Deluge spits out an error to my console:Code: Select all
{"id":2,"method":"core.set_config","params":[[{"max_upload_speed":2},{"max_download_speed":1}]]}
Probably I should send the JSON data in some different format, but I'm not sure how. (I tried several options myself.) Can you provide me an example JSON request string for the set_config method?Code: Select all
[ERROR ] 10:29:02 client:375 RPCError Message Received! -------------------------------------------------------------------------------- RPCRequest: core.set_config([{u'max_upload_speed': 2}, {u'max_download_speed': 1}]) -------------------------------------------------------------------------------- File "/usr/local/lib/python2.6/dist-packages/deluge-1.3.0_dev-py2.6.egg/deluge/core/rpcserver.py", line 281, in dispatch ret = self.factory.methods[method](*args, **kwargs) File "/usr/local/lib/python2.6/dist-packages/deluge-1.3.0_dev-py2.6.egg/deluge/core/core.py", line 478, in set_config for key in config.keys(): AttributeError: 'tuple' object has no attribute 'keys'