sabnzbd

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 24, 2026 License: MIT Imports: 13 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package sabnzbd implements the plugin.DownloadClient interface for SABnzbd's REST API. Tested against SABnzbd 4.x.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client implements plugin.DownloadClient against the SABnzbd API.

func New

func New(cfg Config) *Client

New creates a new SABnzbd client.

func NewWithHTTPClient

func NewWithHTTPClient(cfg Config, client *http.Client) *Client

NewWithHTTPClient creates a Client with a caller-supplied http.Client. Intended for unit tests that need to bypass the safe dialer.

func (*Client) Add

func (c *Client) Add(ctx context.Context, r plugin.Release) (string, error)

Add submits an NZB by URL to SABnzbd. Returns the nzo_id as client item ID.

func (*Client) GetQueue

func (c *Client) GetQueue(ctx context.Context) ([]plugin.QueueItem, error)

GetQueue returns all items from the active queue plus recent history.

func (*Client) Name

func (c *Client) Name() string

func (*Client) Protocol

func (c *Client) Protocol() plugin.Protocol

func (*Client) Remove

func (c *Client) Remove(ctx context.Context, clientItemID string, deleteFiles bool) error

Remove deletes an item from SABnzbd. Tries queue first, then history.

func (*Client) Status

func (c *Client) Status(ctx context.Context, clientItemID string) (plugin.QueueItem, error)

Status returns the state of a single item by nzo_id. Checks the active queue first, then history.

func (*Client) Test

func (c *Client) Test(ctx context.Context) error

Test verifies connectivity by fetching the version, then validates the API key by requesting a queue summary.

type Config

type Config struct {
	URL      string `json:"url"`                // e.g. "http://localhost:8080"
	APIKey   string `json:"api_key"`            // full API key
	Category string `json:"category,omitempty"` // category applied to added NZBs
}

Config holds the connection settings for a SABnzbd instance.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL