Page 1 of 2

Help with unpack script

Posted: 21 Aug 2014, 07:07
by ressof
Hello

I’m trying to make a scan script to unzip files that are uploaded with the web interface. But when I upload a zip file I get an error message saying that "The file could not be added to the queue". How can I prevent this message? And also how can I pass the "category" and "add paused" variables to the unzipped nzb file?

Re: Help with unpack script

Posted: 21 Aug 2014, 07:38
by hugbug
Please take a look at Pre Process script for handling Zip files.

It does support categories but doesn't support paused-flag. Try asking in the topic about adding support for that. It's possible but somewhat tricky: the script must save the flag in an intermediate file and then reuse it (same for priorities).

Re: Help with unpack script

Posted: 21 Aug 2014, 08:48
by ressof
Hi

The script works with the category but I still get an error message when I upload the file with the web interface. See the picture below. I'm running the 13.0 stable release
nzbget.jpg
nzbget.jpg (14.31 KiB) Viewed 4603 times

Re: Help with unpack script

Posted: 21 Aug 2014, 08:58
by hugbug
Any error/warning on messages-tab?

Re: Help with unpack script

Posted: 21 Aug 2014, 09:02
by ressof
No

Re: Help with unpack script

Posted: 21 Aug 2014, 09:07
by hugbug
OK, I'll look into this.

Re: Help with unpack script

Posted: 21 Aug 2014, 09:26
by ressof
Hi

If I replace upload.js from relase 13.0 with upload.js from relase 12.0 the error message dosent appear.
The only thing that is different between the two files is this

Code: Select all

RPC.call('append', [filename, category, priority, false, base64str, addPaused, '', 0, dupeMode], fileCompleted, fileFailure);

Code: Select all

RPC.call('append', [filename, base64str, category, priority, false, addPaused, '', 0, dupeMode], fileCompleted, fileFailure);
and this

Code: Select all

RPC.call('appendurl', ['', category, priority, false, url, addPaused, '', 0, dupeMode], urlCompleted, urlFailure);

Code: Select all

RPC.call('append', ['', url, category, priority, false, addPaused, '', 0, dupeMode], urlCompleted, urlFailure);

Re: Help with unpack script

Posted: 03 Sep 2014, 13:17
by vergessen
I was looking into this on the scripting side and I don't think it is something I can fix from python. The error that is. I will look into adding a pause flag and a priorities flag though I will have to add data file it seems. Something to hold the information for the nzb to catch it on the next scan.

Re: Help with unpack script

Posted: 03 Sep 2014, 19:51
by hugbug
The problem isn't in the script. It's in the NZBGet.
In v12 function "append" returned "true" if no errors happen and "false" if an error happen.
In v13 function "append" returns ID of the added nzb-file or "0" if no file was added, which is considered a failure. However in a case with zip-files although the zip-file isn't added to queue, it's not an error. But the web interface show the error message if "append" returns "0".

This can be fixed only in NZBGet itself. A solution could be to not show any errors for files which have non nzb-extensions.

Re: Help with unpack script

Posted: 04 Sep 2014, 15:30
by vergessen
Ressof,

I am curious about possible usage and how to program for it. You state you are interested in having a pause state added to the script. I have coded this and it works fine I am just stuck on usage. The only way i can see to make the decision is a script setting. Add paused or don't I don't see any possible way to set it on a per run basis. Is this what you were thinking?