NZB enclosures through SABnzbd, as torrents go through qBittorrent (#496)

An episode published as an .nzb was downloaded as if it were the episode:
ipx filed the NZB's XML in the feed's folder. NZBs now go to SABnzbd's API
the way torrents go to qBittorrent since #494, down the same path in scan
(download::Via says which), in the same two slots, counted with torrents.

ipx fetches the .nzb itself through the guarded client, under a 20 MB cap,
and adds it under the [nzb] category as nzb-<enclosure>, the name it finds
the job by again after a restart (#410). Progress is the queue's MB; the
stall clock stops while the history says it is verifying or unpacking, since
a large repair is slow. SABnzbd takes no folder per job, only per category,
so the category's folder has to be inside download_dir: the finished job is
renamed into the episode's own folder (save_path maps SABnzbd's view of the
mount onto ipx's) and taken out of the history, so nothing is left for a
delete to clean up, unlike #495.

Every parameter goes in the request body, the key included: reqwest's
errors print the URL, and a key in the query would have reached the log and
the episode's error. A wrong key comes back as 200 with status false, read
as a refusal.

Off, or with no SABnzbd or key, NZBs are skipped as "NZBs disabled", which
like "torrents disabled" no filter change overturns. An .nzb body behind a
lying MIME type is sniffed and handed on too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RqkrVBuJRne2JAhFpaDV2U
This commit is contained in:
2026-11-22 15:11:14 -05:00
parent 8469db6fa2
commit 5786a0cb1c
11 changed files with 539 additions and 61 deletions

View File

@@ -107,6 +107,24 @@ the same as in ipx's, say where in `save_path`. A `.torrent` body is handed to q
MIME type it was advertised as. Torrents are watched on their own tasks (two at a time) so a slow
swarm never blocks a scan.
```toml
[nzb]
enabled = true
sabnzbd_url = "http://sabnzbd:8080" # empty holds NZBs back
api_key = "" # SABnzbd's API key (Config, General)
category = "ipx" # the category jobs are added under
save_path = "" # where SABnzbd sees download_dir, if not at the same path
stall_mins = 30 # give up on an NZB making no progress
```
NZBs go to [SABnzbd](https://sabnzbd.org/) the same way (#496): ipx fetches the `.nzb`, adds it
under `category` named `nzb-<id>`, follows it through the queue and post-processing, then moves the
finished folder into the episode's own and takes the job out of SABnzbd's history. SABnzbd takes no
folder for a job, only for its category, so give the category a folder inside `download_dir` as
SABnzbd sees it (for example `/ipx-downloads/.sabnzbd`), on the same disk, since the move is a
rename. An `.nzb` body is handed to SABnzbd whatever MIME type it was advertised as, and NZBs share
the torrents' two slots.
## `[web]`
```toml