/DelugeRPCClient.Net

.Net Core Deluge WebUI RPC Client

Primary LanguageC#GNU General Public License v3.0GPL-3.0

DelugeRPCClient.Net .NET

.Net DelugeWeb RPC Client is a refactorisation of the great work done by SilverCard on DelugeWebClient


This library allows you to connect to the delugeweb RPC API. Some methods have been implemented, others will come according to needs or requests. The library targets multiple frameworks :

  • .Net Core 3.1
  • .Net Core 5
  • .Net Core 6
  • .NET Standard 2.0
  • .NET 4.8

Installation

Simply download and restore nuget packages https://www.nuget.org/packages/DelugeRPCClient.Net/ or install it from package manager

PM> Install-Package DelugeRPCClient.Net -Version x.x.x

Create a DelugeClient Object

DelugeClient client = new DelugeClient(url: Constants.DelugeUrl, password: Constants.DelugePassword);

Authentification

Login

bool loginResult = await client.Login();

Logout

bool logoutResult = await client.Logout();

Torrents

List and Get torrents

List torrents

List<Torrent> torrents = await client.ListTorrents();

Get torrent by hash

Torrent torrent = await client.GetTorrent(torrentHash);

Add Torrent

Add a torrent by magnet uri

Torrent torrent = await client.AddTorrentByMagnet(torrentMagnetUri);

Add a torrent by .torrent file

Torrent torrent = await client.AddTorrentByFile(torrentFilename);

Remove Torrent

bool removeTorrentResult = await client.RemoveTorrent(torrentHash);

Pause and Resume Torrent

Pause Torrent

bool pauseResult = await client.PauseTorrent(torrentHash);

Resume Torrent

bool resumeResult = await client.ResumeTorrent(torrentHash);

Labels

List existing labels

List<string> labels = await client.ListLabels();

Check if a label exists

bool exists = await client.LabelExists(label);

Add a new label

bool addLabelResult = await client.AddLabel(label);

Remove an existing label

bool removeLabelResult = await client.RemoveLabel(label);

Assing a label to a torrent (if label dont exists it will be created)

bool assignResult = await client.SetTorrentLabel(torrentHash, label);