Documentation
¶
Overview ¶
Package deluge implements the plugin.DownloadClient interface for the Deluge Web API (JSON-RPC over HTTP). Tested against Deluge 2.x.
Index ¶
- type Client
- func (c *Client) Add(ctx context.Context, r plugin.Release) (string, error)
- func (c *Client) GetQueue(ctx context.Context) ([]plugin.QueueItem, error)
- func (c *Client) Name() string
- func (c *Client) Protocol() plugin.Protocol
- func (c *Client) Remove(ctx context.Context, clientItemID string, deleteFiles bool) error
- func (c *Client) SetSeedLimits(ctx context.Context, clientItemID string, ratioLimit float64, seedTimeSecs int) error
- func (c *Client) Status(ctx context.Context, clientItemID string) (plugin.QueueItem, error)
- func (c *Client) Test(ctx context.Context) error
- type Config
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 ¶
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 ¶
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) Remove ¶
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).
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.