Help with unpack script

Get help, report and discuss bugs.
ressof
Posts: 6
Joined: 21 Aug 2014, 07:03

Help with unpack script

Post by ressof » 21 Aug 2014, 07:07

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?

hugbug
Developer & Admin
Posts: 7645
Joined: 09 Sep 2008, 11:58
Location: Germany

Re: Help with unpack script

Post by hugbug » 21 Aug 2014, 07:38

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).

ressof
Posts: 6
Joined: 21 Aug 2014, 07:03

Re: Help with unpack script

Post by ressof » 21 Aug 2014, 08:48

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 4594 times

hugbug
Developer & Admin
Posts: 7645
Joined: 09 Sep 2008, 11:58
Location: Germany

Re: Help with unpack script

Post by hugbug » 21 Aug 2014, 08:58

Any error/warning on messages-tab?

ressof
Posts: 6
Joined: 21 Aug 2014, 07:03

Re: Help with unpack script

Post by ressof » 21 Aug 2014, 09:02

No

hugbug
Developer & Admin
Posts: 7645
Joined: 09 Sep 2008, 11:58
Location: Germany

Re: Help with unpack script

Post by hugbug » 21 Aug 2014, 09:07

OK, I'll look into this.

ressof
Posts: 6
Joined: 21 Aug 2014, 07:03

Re: Help with unpack script

Post by ressof » 21 Aug 2014, 09:26

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);

vergessen
Posts: 23
Joined: 19 Feb 2014, 15:36

Re: Help with unpack script

Post by vergessen » 03 Sep 2014, 13:17

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.

hugbug
Developer & Admin
Posts: 7645
Joined: 09 Sep 2008, 11:58
Location: Germany

Re: Help with unpack script

Post by hugbug » 03 Sep 2014, 19:51

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.

vergessen
Posts: 23
Joined: 19 Feb 2014, 15:36

Re: Help with unpack script

Post by vergessen » 04 Sep 2014, 15:30

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?

Post Reply

Who is online

Users browsing this forum: No registered users and 58 guests