Skip to content

valcriss/DelugeRPCClient.Net

Repository files navigation

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);

Create a DelugeClient Object with advanced options

DelugeClientConfig config = new DelugeClientConfig()
{
    IgnoreSslErrors = true,
    Timeout = new TimeSpan(0, 0, 30)
};

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

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();

List torrents extended

List<TorrentExtended> torrents = await client.ListTorrentsExtended();

Get torrent by hash

Torrent torrent = await client.GetTorrent(torrentHash);

Get torrent extended by hash

TorrentExtended torrent = await client.GetTorrentExtended(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);

Add a torrent by .torrent url

Torrent torrent = await client.AddTorrentByUrl(torrentUrl);

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);

Recheck Torrents

bool recheckTorrentResult = await client.RecheckTorrents(List<string> torrentsHash);

Configs

List configs

List<Config> config = await client.ListConfigs();

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);

About

.Net Core Deluge WebUI RPC Client

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages