Reading response from webui/json
Posted: Mon Jan 23, 2017 8:48 pm
I'm using python to connect to the web ui. I can log in fine, but if I supply an in correct password the response is always 'OK' as well, which isn't super helpful.
The response.msg is *always* "OK". But I can see in my deluge-web stdout the message
How can I get feedback from the json api to discern a bad password?
Code: Select all
url = 'http://localhost:8112/json'
command = {'method': 'auth.login',
'params': [password],
'id': command_id
}
command_id += 1
command = json.dumps(command)
request = urllib2.Request(url, command, headers={'User-Agent': 'Mozilla/5.0'})
try:
response = urllib2.urlopen(request)
[etc...]
Code: Select all
[ERROR ] 23:37:05 auth:329 Login failed (ClientIP 123.456.789.876)