.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
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
DelugeClient client = new DelugeClient(url: Constants.DelugeUrl, password: Constants.DelugePassword);
DelugeClientConfig config = new DelugeClientConfig()
{
IgnoreSslErrors = true,
Timeout = new TimeSpan(0, 0, 30)
};
DelugeClient client = new DelugeClient(url: Constants.DelugeUrl, password: Constants.DelugePassword, config);
bool loginResult = await client.Login();
bool logoutResult = await client.Logout();
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 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);
bool removeTorrentResult = await client.RemoveTorrent(torrentHash);
Pause Torrent
bool pauseResult = await client.PauseTorrent(torrentHash);
Resume Torrent
bool resumeResult = await client.ResumeTorrent(torrentHash);
bool recheckTorrentResult = await client.RecheckTorrents(List<string> torrentsHash);
List<Config> config = await client.ListConfigs();
List<string> labels = await client.ListLabels();
bool exists = await client.LabelExists(label);
bool addLabelResult = await client.AddLabel(label);
bool removeLabelResult = await client.RemoveLabel(label);
bool assignResult = await client.SetTorrentLabel(torrentHash, label);