[New Feature] General scripts concept
Posted: 06 May 2014, 16:02
The post-processing scripts concept initially introduced in v11 has provided an easy way to install and configure post-processing scripts. This made it easier for users to share their scripts. Although post-processing scripts are the most important scripts there are also other kinds of scripts used in the program:
Details:
Documenation
The documentation page for post-processing scripts will be extended with info on writing scan, queue and scheduler scripts. Basically the scripts need signature to be recognized as such and the scripts now have the whole environment similar to post-processing scripts (program options, script options). The following signatures are used:
One script can be used for multiple purposes. It need a mixed signature then, for example:
or
Feedback
Please ask any questions or report problems in this topic.
- scan-script, called for each nzb-file or any other file found in the incoming nzb-directory. The script is called before the nzb-file is added to queue (option NzbProcess);
- queue-script, called for each nzb-file after it is added to queue (option NzbAddedProcess);
- scheduler scripts, which are executed by task scheduler (option TaskX.Process).
Details:
- option "NzbProcess" renamed to "ScanScript";
- option "NzbAddedProcess" renamed to "QueueScript";
- option "DefScript" and "CategoryX.DefScript" renamed to "PostScript" and "CategoryX.PostScript" (options with old names are recognized and automatically converted on first settings saving);
- new option "TaskX.Script"; old option "TaskX.Process" kept for scheduling of external programs not related to nzbget (to avoid writing of intermediate proxy scripts);
- scan-script, queue-script and scheduler-script now work similar to post-processing scripts:
- scripts must be put into scripts-directory;
- scripts can be configured via web-interface and can have options;
- multiple scripts can be chosen for each scripts-option, all chosen scripts are executed;
- program and script options are passed to the script as env. variables;
- renamed default directory with scripts from "ppscripts" to "scripts";
- script signature indicates the type of script (post-processing, scan, queue or scheduler);
- one script can have mixed signature allowing it to be used for multiple purposes (for example a notification script can send a notification on both events: after adding to queue and after post-processing);
- result of RPC-method "configtemplates" has new fields "PostScript", "ScanScript", "QueueScript", "SchedulerScript" to indicate the purpose of the script;
- queue-script (formerly NzbAddedProcess) has new parameter "NZBNA_EVENT" indicating the reason of calling the script;
- currently the script is called only after adding of files to download queue and therefore the parameter is always set to "NZB_ADDED" but the queue-script can be called on other events in the future too
Documenation
The documentation page for post-processing scripts will be extended with info on writing scan, queue and scheduler scripts. Basically the scripts need signature to be recognized as such and the scripts now have the whole environment similar to post-processing scripts (program options, script options). The following signatures are used:
Code: Select all
### NZBGET SCAN SCRIPT
### NZBGET QUEUE SCRIPT
### NZBGET SCHEDULER SCRIPT
Code: Select all
### NZBGET SCAN/QUEUE SCRIPT
Code: Select all
### NZBGET SCAN/POST-PROCESSING SCRIPT
Please ask any questions or report problems in this topic.