Deluge Web Client
Project description
User Guide and API Reference available on Read the Docs.
Features
-
Provides access to the majority of Web API methods as well as key core functionalities through RPC. For more details, see the official Web API Documentation and RPC API Documentation.
-
Allows you to use direct http connections, allowing access via reverse proxy or any direct url.
Installation
Install via pip from PyPI:
python -m pip install deluge-web-client
# or
poetry add deluge-web-client
# or
uv add deluge-web-client
Getting Started
Before getting started, ensure that you have a running instance of Deluge with the WebUI enabled. You will also need to have a user set up for authentication. For guidance on setting up the WebUI, visit the Deluge setup guide. Another good tutorial is Trash-Guides basic setup.
Basic Usage
from deluge_web_client import DelugeWebClient
# instantiate a client
client = DelugeWebClient(url="https://site.net/deluge", password="example_password")
# login
# once logged in the `client` will maintain the logged in state as long as you don't call
# client.disconnect()
client.login()
# uploading a torrent
# 1) define your torrent options (what ever you don't set here will utilize Deluge defaults)
torrent_options = TorrentOptions(
add_paused=True,
auto_managed=True,
)
# 2) upload the torrent and capture the returned output
upload = client.upload_torrent(
torrent_path="filepath.torrent",
torrent_options=torrent_options,
)
# this will return a `Response` object
print(upload)
# Response(result=True, error=None, id=1)
# retrieve and show all torrents
all_torrents = client.get_torrents_status()
# pause torrent (pass torrent hash)
pause_torrent = client.pause_torrent("0407326f9d74629d299b525bd5f9b5dd583xxxx")
# remove torrent
remove_torrent = client.remove_torrent("0407326f9d74629d299b525bd5f9b5dd583xxxx")
Context Manager
from deluge_web_client import DelugeWebClient
# using a context manager automatically logs you in
with DelugeWebClient(url="https://site.net/deluge", password="example_password") as client:
torrent_options = TorrentOptions(
add_paused=True,
auto_managed=True,
)
upload = client.upload_torrent(
torrent_path="filepath.torrent",
torrent_options=torrent_options,
)
print(upload)
# Response(result="0407326f9d74629d299b525bd5f9b5dd583xxxx", error=None, id=1)
Notes
Calling client.disconnect() will log the user out of the WebUI in both the client and any connected web browser. Be cautious if you're also logged in to the WebUI via your browser as this will terminate your session there as well.
Access RPC Directly
This package uses HTTP to connect to the Deluge client, relying on the Web API / JSON to handle these calls. It's fully capable of making all core calls to the Deluge backend. However, if you are looking for a package focused solely on RPC, consider deluge-client, which served as inspiration for this project alongside qbittorrent-api.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file deluge_web_client-2.0.3.tar.gz.
File metadata
- Download URL: deluge_web_client-2.0.3.tar.gz
- Upload date:
- Size: 22.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
04d520dc53da901ca183dad7b1ee944e3f2f17c79fd06e87eefbf158d54ce21a
|
|
| MD5 |
d6fbc370d4280f3ec885864c03d96bcd
|
|
| BLAKE2b-256 |
8af3bfcc00d5973d3c8c2aa97119595c4ef7cf03ebf56d18ef514e841232253d
|
Provenance
The following attestation bundles were made for deluge_web_client-2.0.3.tar.gz:
Publisher:
python_publish.yml on jessielw/deluge-web-client
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
deluge_web_client-2.0.3.tar.gz -
Subject digest:
04d520dc53da901ca183dad7b1ee944e3f2f17c79fd06e87eefbf158d54ce21a - Sigstore transparency entry: 767463547
- Sigstore integration time:
-
Permalink:
jessielw/deluge-web-client@549b2526996864c5b8242050cb8788c5a4d3233d -
Branch / Tag:
refs/tags/2.0.3 - Owner: https://github.com/jessielw
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python_publish.yml@549b2526996864c5b8242050cb8788c5a4d3233d -
Trigger Event:
release
-
Statement type:
File details
Details for the file deluge_web_client-2.0.3-py3-none-any.whl.
File metadata
- Download URL: deluge_web_client-2.0.3-py3-none-any.whl
- Upload date:
- Size: 14.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e16dc0bd63bbc813ba5bcaf38eebbe3a6d8b3c222091832c119c50903af4d0a2
|
|
| MD5 |
de95c3a7d129206a87cfedd87c54da98
|
|
| BLAKE2b-256 |
dd6623da92614b9af86434e474df528b4f27b7a2c158f7484990c00b46394c35
|
Provenance
The following attestation bundles were made for deluge_web_client-2.0.3-py3-none-any.whl:
Publisher:
python_publish.yml on jessielw/deluge-web-client
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
deluge_web_client-2.0.3-py3-none-any.whl -
Subject digest:
e16dc0bd63bbc813ba5bcaf38eebbe3a6d8b3c222091832c119c50903af4d0a2 - Sigstore transparency entry: 767463548
- Sigstore integration time:
-
Permalink:
jessielw/deluge-web-client@549b2526996864c5b8242050cb8788c5a4d3233d -
Branch / Tag:
refs/tags/2.0.3 - Owner: https://github.com/jessielw
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python_publish.yml@549b2526996864c5b8242050cb8788c5a4d3233d -
Trigger Event:
release
-
Statement type: