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:
|
if hash == download_id:
|
||||||
return True
|
return True
|
||||||
if clientAgent == 'deluge':
|
if clientAgent == 'deluge':
|
||||||
pass
|
return False
|
||||||
if clientAgent == 'sabnzbd':
|
if clientAgent == 'sabnzbd':
|
||||||
baseURL = "http://%s:%s/api" % (nzbtomedia.SABNZBDHOST, nzbtomedia.SABNZBDPORT)
|
baseURL = "http://%s:%s/api" % (nzbtomedia.SABNZBDHOST, nzbtomedia.SABNZBDPORT)
|
||||||
url = baseURL
|
url = baseURL
|
||||||
|
@ -695,11 +695,12 @@ def find_download(clientAgent, download_id):
|
||||||
r = requests.get(url, params=params, verify=False)
|
r = requests.get(url, params=params, verify=False)
|
||||||
except requests.ConnectionError:
|
except requests.ConnectionError:
|
||||||
logger.error("Unable to open URL")
|
logger.error("Unable to open URL")
|
||||||
return 1 # failure
|
return False # failure
|
||||||
|
|
||||||
result = r.json()
|
result = r.json()
|
||||||
if result['files']:
|
if result['files']:
|
||||||
return True
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
def cleanFileName(filename):
|
def cleanFileName(filename):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue