mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-21 13:53:15 -07:00
get download id from SABnzbd
This commit is contained in:
parent
cbc99fa0cf
commit
47289c903a
1 changed files with 3 additions and 2 deletions
|
@ -682,7 +682,7 @@ def find_download(clientAgent, download_id):
|
|||
if hash == download_id:
|
||||
return True
|
||||
if clientAgent == 'deluge':
|
||||
pass
|
||||
return False
|
||||
if clientAgent == 'sabnzbd':
|
||||
baseURL = "http://%s:%s/api" % (nzbtomedia.SABNZBDHOST, nzbtomedia.SABNZBDPORT)
|
||||
url = baseURL
|
||||
|
@ -695,11 +695,12 @@ def find_download(clientAgent, download_id):
|
|||
r = requests.get(url, params=params, verify=False)
|
||||
except requests.ConnectionError:
|
||||
logger.error("Unable to open URL")
|
||||
return 1 # failure
|
||||
return False # failure
|
||||
|
||||
result = r.json()
|
||||
if result['files']:
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
def cleanFileName(filename):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue