deluge

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: 16 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 deluge implements the plugin.DownloadClient interface for the Deluge Web API (JSON-RPC over HTTP). Tested against Deluge 2.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 Deluge Web JSON-RPC API.

func New

func New(cfg Config) *Client

New creates a new Deluge client. Call Test to verify connectivity. Outbound HTTP uses safedialer.LANTransport() because download clients are typically hosted on localhost or a LAN address.

func (*Client) Add

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

Add submits a torrent to Deluge. Magnet URIs are added directly via core.add_torrent_magnet. HTTP/HTTPS .torrent URLs are fetched by Pilot, base64-encoded, and sent via core.add_torrent_file.

func (*Client) GetQueue

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

GetQueue returns all torrents currently tracked by Deluge.

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 removes a torrent from Deluge. If deleteFiles is true the downloaded data is also deleted from disk.

func (*Client) SetSeedLimits

func (c *Client) SetSeedLimits(ctx context.Context, clientItemID string, ratioLimit float64, seedTimeSecs int) error

SetSeedLimits sets per-torrent seed ratio and time limits via Deluge's core.set_torrent_options RPC method. ratioLimit <= 0 and seedTimeSecs <= 0 are ignored (no change sent to Deluge).

func (*Client) Status

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

Status returns the current state of a single torrent by its info hash.

func (*Client) Test

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

Test verifies connectivity and authentication.

type Config

type Config struct {
	URL      string `json:"url"`                 // e.g. "http://localhost:8112"
	Password string `json:"password"`            // Web UI password (default: "deluge")
	Label    string `json:"label,omitempty"`     // label/category applied to added torrents
	SavePath string `json:"save_path,omitempty"` // custom save path (empty = Deluge default)
}

Config holds the connection settings for a Deluge Web UI instance.

Jump to

Keyboard shortcuts

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