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

@@ -19,7 +19,7 @@ behind iPodderX (2004-2008, Ray Slakinski & August Trometer).
- **Scanning.** Feeds are checked on a schedule, globally or per feed, and a feed's own TTL is
honoured. Keyword, explicit-content and media-type filters decide what is downloaded, with a limit
on how many of a feed's newest episodes are downloaded.
- **Downloads.** Files come over HTTP, or BitTorrent through qBittorrent, and are filed into a folder per feed.
- **Downloads.** Files come over HTTP, BitTorrent through qBittorrent, or Usenet through SABnzbd, and are filed into a folder per feed.
Retention deletes the oldest files to stay under a disk quota or an age limit, and never touches
an item someone has pinned.
- **OPML.** You can import and export your own subscriptions. You can also subscribe to an OPML
@@ -38,7 +38,7 @@ docker compose up -d
`docker-compose.yml` is a sample: ipx, with its database in SQLite and its three volumes
(`/config`, `/data` and `/downloads`) in folders beside the file, and ipx-web, the page, served by
Caddy in front of it. Change them to suit. The UI is on port 8099. Torrents need a qBittorrent
of your own, set in `[torrent]` (docs/configuration.md). Files are written as `PUID`/`PGID`, 99:100 by default.
of your own, set in `[torrent]`, and NZBs a SABnzbd, set in `[nzb]` (docs/configuration.md). Files are written as `PUID`/`PGID`, 99:100 by default.
From source: