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:
@@ -54,6 +54,7 @@ id, and Caddy's request lines theirs. ipx also serves Prometheus metrics (`[web]
|
||||
| `crates/feed/src/guard.rs` | The connection guard against internal addresses (#320) | — |
|
||||
| `crates/ipx/src/download.rs` | Streaming download, naming, type sniffing, placement | `iPXDownloader.getFile` |
|
||||
| `crates/ipx/src/torrent.rs` | Hands torrents to qBittorrent's Web API and watches them to the end, stall abort | vendored BitTorrent 4.2.1 |
|
||||
| `crates/ipx/src/nzb.rs` | Hands NZBs to SABnzbd's API, watches them through post-processing, moves the finished folder in | |
|
||||
| `crates/ipx/src/retention.rs` | Quota and age sweeps | `iPXQuotaManager.py` |
|
||||
| `crates/ipx/src/ipc.rs` | Event and command types, the socket server | `printMSG` on stdout |
|
||||
| `crates/ipx/src/auth.rs` | Argon2id hashing, session tokens, header names | — |
|
||||
@@ -102,7 +103,7 @@ and the files, and no page.
|
||||
a reason. What a filter skipped is judged again every scan, so a change of settings brings it
|
||||
back. A feed in a group takes your settings on the group for anything you have not set on it.
|
||||
7. Download what is still pending, newest first, up to the per-scan cap. A `.torrent` body goes to
|
||||
qBittorrent whatever its advertised type; an HTML body is a failed download — a login wall
|
||||
qBittorrent and an `.nzb` body to SABnzbd whatever its advertised type; an HTML body is a failed download — a login wall
|
||||
or an error page — and is deleted.
|
||||
|
||||
## Data model
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user