I'm not sure if this is possible (I guess it depends on when a queued item gets an NZO_ID), but I was hoping that SABnzbd could return the NZO_ID when a new item is sent to the queue, allowing tracking of that NZO_ID through the queuing, downloading and post-procesing process.
In addition it would be nice to be able to query SABnzbd for a NZO_ID and have SABnzbd return its current status, queued, downloading, post-processing, complete, etc.
I'm primarily inquiring about the first request, the latter would be an added bonus.
Thanks for all the great work.
-Markus
addurl/addid - Return NZO_ID
Re: addurl/addid - Return NZO_ID
It's probably possible, but I need to look into this.
You won't get one when you send an URL of an indexing site.
You won't get one when you send an URL of an indexing site.
Re: addurl/addid - Return NZO_ID
First part is implemented.
0.7.0 will return a list of nzo_ids.
JSON example:ZIP-files with NZBs will return multiple nzo_ids, in other cases the list will have only one element.
I'll think about the other request.
0.7.0 will return a list of nzo_ids.
JSON example:
Code: Select all
{"status":0,"nzo_ids":["SABnzbd_nzo_bjibsz", "SABnzbd_nzo_ihfghs"]}
I'll think about the other request.
Re: addurl/addid - Return NZO_ID
Awesome. Thanks. To confirm whayt situations will this json be returned?
Directing Sab to a local nzb file?
Posting a nzb file to sab?
Add by URL? (I think this is a no)
Directing Sab to a local nzb file?
Posting a nzb file to sab?
Add by URL? (I think this is a no)
Re: addurl/addid - Return NZO_ID
API functions "addfile" (upload) and "addlocalfile".
Not "addid" and "addurl", because it could take hours before you have a result.
The "nzo_id" isn't known yet.
In fact, the "fetch" items do have an identifier, but it changes once the job becomes '"real".
So in principle it could return the temporary id for the addurl call, but it won't be the handle
for the final entry.
Not "addid" and "addurl", because it could take hours before you have a result.
The "nzo_id" isn't known yet.
In fact, the "fetch" items do have an identifier, but it changes once the job becomes '"real".
So in principle it could return the temporary id for the addurl call, but it won't be the handle
for the final entry.
Re: addurl/addid - Return NZO_ID
I grab the nzo_id by looping thought the queue asking for the nzb name
Code: Select all
def nzo_id(self, nzbname):
url = self.baseurl + "&mode=queue&start=START&limit=LIMIT&output=xml"
doc = _load_xml(url)
sab_nzo_id = None
if doc:
if doc.getElementsByTagName("slot"):
for slot in doc.getElementsByTagName("slot"):
filename = get_node_value(slot, "filename")
if filename.lower() == nzbname.lower():
sab_nzo_id = get_node_value(slot, "nzo_id")
return sab_nzo_id