Rewrite dictionary creation as a dictionary literal

This commit is contained in:
Labrys 2016-06-05 09:55:56 -04:00
commit 47c585d81c
2 changed files with 45 additions and 41 deletions

View file

@ -870,11 +870,12 @@ def find_download(clientAgent, download_id):
else:
baseURL = "http://%s:%s/api" % (core.SABNZBDHOST, core.SABNZBDPORT)
url = baseURL
params = {}
params['apikey'] = core.SABNZBDAPIKEY
params['mode'] = "get_files"
params['output'] = 'json'
params['value'] = download_id
params = {
'apikey': core.SABNZBDAPIKEY,
'mode': "get_files",
'output': 'json',
'value': download_id,
}
try:
r = requests.get(url, params=params, verify=False, timeout=(30, 120))
except requests.ConnectionError:
@ -896,10 +897,11 @@ def get_nzoid(inputName):
else:
baseURL = "http://%s:%s/api" % (core.SABNZBDHOST, core.SABNZBDPORT)
url = baseURL
params = {}
params['apikey'] = core.SABNZBDAPIKEY
params['mode'] = "queue"
params['output'] = 'json'
params = {
'apikey': core.SABNZBDAPIKEY,
'mode': "queue",
'output': 'json',
}
try:
r = requests.get(url, params=params, verify=False, timeout=(30, 120))
except requests.ConnectionError: