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:
|
||||
logger.error("Unable to open URL")
|
||||
return nzoid # failure
|
||||
try:
|
||||
result = r.json()
|
||||
for slot in result['slots']:
|
||||
for slot in result['queue']['slots']:
|
||||
if slot['filename'] == inputName:
|
||||
nzoid = slot['nzo_id']
|
||||
logger.debug("Found nzoid: %s" % nzoid)
|
||||
break
|
||||
except:
|
||||
logger.warning("Data from SABnzbd could not be parsed")
|
||||
return nzoid
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue