Page 1 of 1
Retry failed or empty nzb's after xx amount of time
Posted: March 11th, 2012, 11:30 am
by smaniac
Hello everyone!
I'm sure I'm not the only one to have noticed but sometimes when for example Sickbeard gives SABnzbd download links these are not yet available and then an error like this occurs:
Code: Select all
WARNING: Empty NZB file download.php?id=SOMENUMBERS&username=USERNAME&apikey=APIKEY&scenename=1.nzb
It would be nice to have an option where one can tell SABnzbd to retry said failed or empty nzb.
I'm thinking something like retry X amount of times XX minutes apart.
Thanks
SmAnIaC
Re: Retry failed or empty nzb's after xx amount of time
Posted: March 11th, 2012, 2:38 pm
by shypike
The alternative is to ask your indexer site to get their act together.
It already does a bunch of retries.
There's a limit to the amount of compensation that SABnzbd can do for everybody else's mistakes.
Re: Retry failed or empty nzb's after xx amount of time
Posted: March 12th, 2012, 9:14 am
by smaniac
This is the only code I could find within the python scripts that gives the exact error I and many others are getting:
Code: Select all
if nzb and '<nzb' in nzb:
if 'A&A)' in nzb:
# Fix needed to compensate for some dumb NZB posters
nzb = nzb.replace('A&A)', 'A&A)')
handler = NzbParser(self, cfg.ignore_samples() == 2 and not reuse)
parser = xml.sax.make_parser()
parser.setFeature(xml.sax.handler.feature_external_ges, 0)
parser.setContentHandler(handler)
parser.setErrorHandler(xml.sax.handler.ErrorHandler())
inpsrc = xml.sax.xmlreader.InputSource()
inpsrc.setByteStream(StringIO(nzb))
try:
parser.parse(inpsrc)
except xml.sax.SAXParseException, err:
self.purge_data(keep_basic=reuse)
logging.warning(Ta('Invalid NZB file %s, skipping (reason=%s, line=%s)'),
filename, err.getMessage(), err.getLineNumber())
raise ValueError
except IOError:
self.purge_data(keep_basic=reuse)
logging.warning(Ta('Cannot save NZB admin files for "%s"'), latin1(self.work_name))
raise ValueError
except Exception, err:
self.purge_data(keep_basic=reuse)
logging.warning(Ta('Invalid NZB file %s, skipping (reason=%s, line=%s)'), filename, err, 0)
raise ValueError
sabnzbd.backup_nzb(filename, nzb)
sabnzbd.save_compressed(adir, filename, nzb)
if not self.files and not reuse:
self.purge_data(keep_basic=False)
logging.warning(Ta('Empty NZB file %s'), filename)
raise ValueError
Isn't there a way to let pause for 15 min and the loop for the specific file at hand?
Re: Retry failed or empty nzb's after xx amount of time
Posted: March 12th, 2012, 1:02 pm
by shypike
If it "crashes" there, it means that the site didn't even send an empty NZB file
but some html page meant for human eyes, not for software like SABnzbd.
I assume we're talking about nzbmatrix here?
Re: Retry failed or empty nzb's after xx amount of time
Posted: March 13th, 2012, 4:41 am
by smaniac
Yes you assumption is correct! It is with nzb's from nzbmatrix!
Re: Retry failed or empty nzb's after xx amount of time
Posted: March 13th, 2012, 11:23 am
by shypike
nzbmatrix has an API (which we use), that is fully capable of sending a proper error code.
Instead they choose to send some dumb HTML page.
Of course you're just the innocent bystander, but I have little motivation to compensate for their behaviour.