Skip to content

Post-Processing Scripts

Weaver’s pipeline handles verification, repair, extraction, and the move itself. Scripts run after that, against the finished output, under the exact environment contract SABnzbd or NZBGet would give them. Existing scripts run unmodified.

Execution is off by default, because an enabled script runs with Weaver’s privileges. Turn it on under Settings → Post-processing, which is marked beta. WEAVER_STRICT_SECURITY refuses script execution regardless of the switch.

The same page sets concurrency, the termination grace period after a timeout (10 seconds by default), interpreter paths for Python, PowerShell, and batch scripts, and the unacceptable extensions list that fails a job whose output matches a pattern such as *.exe.

Drop a script, or a folder containing an NZBGet manifest.json, into scripts inside the data directory. In Docker that is /config/scripts. Weaver lists the folder live: adding, editing, or renaming takes effect immediately, and anything it cannot parse is listed as a problem rather than hidden.

The adapter is detected per script:

Script carriesContract
Nothing specialSABnzbd: SAB_* variables and the positional arguments, nonzero exit recorded as a warning
NZBGet’s header comment or a manifest.jsonNZBGet: NZBPP_*, NZBPO_*, and NZBOP_* variables, exit 93 success, 94 failure, 95 skipped

Options declared by an NZBGet manifest become inputs on the script job. Values marked secret are kept encrypted, and can be shared between jobs as named secrets.

A script does nothing until it is wired to a trigger as a script job: the post-processing trigger for scripts that run after a download, plus queue events, scans, schedules, and feeds. Each job carries its own inputs, categories, blocking flag, and time limit. Global jobs run first and category jobs run after them. Creating jobs, testing them, secrets, and the Runs table are covered in Scripts.

Each script’s name, outcome, duration, and the tail of its output are recorded on the job and shown in Job Detail’s event log. Outcomes are succeeded, skipped, warned, failed, cancelled, and timed out. Re-run scripts in Job Detail repeats the list against the finished output.