mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-21 05:43:16 -07:00
fix SABnzbd nzoid find.
This commit is contained in:
parent
a5a3bd20f7
commit
912e639c4f
1 changed files with 9 additions and 5 deletions
|
@ -823,11 +823,15 @@ def get_nzoid(inputName):
|
||||||
except requests.ConnectionError:
|
except requests.ConnectionError:
|
||||||
logger.error("Unable to open URL")
|
logger.error("Unable to open URL")
|
||||||
return nzoid # failure
|
return nzoid # failure
|
||||||
result = r.json()
|
try:
|
||||||
for slot in result['slots']:
|
result = r.json()
|
||||||
if slot['filename'] == inputName:
|
for slot in result['queue']['slots']:
|
||||||
nzoid = slot['nzo_id']
|
if slot['filename'] == inputName:
|
||||||
break
|
nzoid = slot['nzo_id']
|
||||||
|
logger.debug("Found nzoid: %s" % nzoid)
|
||||||
|
break
|
||||||
|
except:
|
||||||
|
logger.warning("Data from SABnzbd could not be parsed")
|
||||||
return nzoid
|
return nzoid
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue