Skip to content

fix(sabnzbd): use Content-Disposition header for NZB filename on addurl - #407

Merged
javi11 merged 1 commit into
mainfrom
fix/content-disposition-nzb-filename
Mar 11, 2026
Merged

fix(sabnzbd): use Content-Disposition header for NZB filename on addurl#407
javi11 merged 1 commit into
mainfrom
fix/content-disposition-nzb-filename

Conversation

@javi11

@javi11 javi11 commented Mar 11, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • When downloading NZBs via the SABnzbd addurl command, indexers like NZBHydra2 (/getnzb/user/123456) or Prowlarr (/api) return meaningless URL-based filenames
  • Parse the Content-Disposition response header first to get the human-readable filename (e.g. Some Awesome Video Part1.nzb)
  • Fall back to URL path basename, then downloaded.nzb if neither is available
  • The existing .nzb extension enforcement is unchanged and handles all paths correctly

Test plan

  • make builds successfully (no compilation errors)
  • Send addurl with a URL whose response includes Content-Disposition: inline; filename="My Show S01E01.nzb" — verify queue item is named My Show S01E01
  • Confirm fallback: URL without Content-Disposition still uses URL path basename
  • Confirm final fallback: opaque URL with no Content-Disposition uses downloaded.nzb

🤖 Generated with Claude Code

FIX #403

When downloading NZBs from indexers like NZBHydra2 or Prowlarr, the URL
path often yields meaningless names (e.g. "123456.nzb" or "api.nzb").
Parse the Content-Disposition response header first and fall back to the
URL path, then "downloaded.nzb" if neither is available.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@javi11
javi11 merged commit 66f3a83 into main Mar 11, 2026
2 checks passed
@javi11
javi11 deleted the fix/content-disposition-nzb-filename branch March 11, 2026 13:42
yoshitaka420 pushed a commit to yoshitaka420/altmount that referenced this pull request Jun 1, 2026
…rl (kipsilabs#407)

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request: Use the Content-Disposition filename when downloading NZBs via SABnzbd API

1 participant