This class subscribes to events from the core and stores them until all the subscribed listeners have received the events.
Add a listener to the event queue.
| Parameters: |
|
|---|
Retrieve the pending events for the listener.
| Parameter: | listener_id (string) – A unique id for the listener |
|---|
Remove a listener from the event queue.
| Parameters: |
|
|---|
The component that implements all the methods required for managing the web interface. The complete web json interface also exposes all the methods available from the core RPC.
Adds a host to the list.
| Parameters: |
|
|---|
Add torrents by file
| Parameter: | torrents (list) – A list of dictionaries containing the torrent path and torrent options to add with. |
|---|
Usage
>>> json_api.web.add_torrents([{
"path": "/tmp/deluge-web/some-torrent-file.torrent",
"options": {"download_path": "/home/deluge/"}
}])
Connect the client to a daemon
| Parameter: | host_id (string) – the id of the daemon in the host list |
|---|---|
| Returns: | the methods the daemon supports |
| Return type: | list |
The current connection state.
| Returns: | True if the client is connected |
|---|---|
| Return type: | booleon |
Remove an event listener from the event queue.
| Parameter: | event (string) – The event name |
|---|
Download a torrent file from a url to a temporary directory.
| Parameter: | url (string) – the url of the torrent |
|---|---|
| Returns: | the temporary file name of the torrent file |
| Return type: | string |
Get the configuration dictionary for the web interface.
| Return type: | dictionary |
|---|---|
| Returns: | the configuration |
Return the information about a host
| Parameter: | host_id (string) – the id of the host |
|---|---|
| Returns: | the host information |
| Return type: | list |
Returns the current status for the specified host.
| Parameter: | host_id (string) – the hash id of the host |
|---|
Gets the files for a torrent in tree format
| Parameter: | torrent_id (string) – the id of the torrent to retrieve. |
|---|---|
| Returns: | The torrents files in a tree |
| Return type: | dictionary |
Return information about a torrent on the filesystem.
| Parameter: | filename (string) – the path to the torrent |
|---|---|
| Returns: | information about the torrent: |
{
"filename": the torrent file,
"name": the torrent name,
"size": the total size of the torrent,
"files": the files the torrent contains,
"info_hash" the torrents info_hash
}
| Return type: | dictionary |
|---|
Add a listener to the event queue.
| Parameter: | event (string) – The event name |
|---|
Removes a host for the list
| Parameter: | host_id (string) – the hash id of the host |
|---|
Sets the configuration dictionary for the web interface.
| Parameter: | config (dictionary) – The configuration options to update |
|---|
Stops a running daemon.
| Parameter: | host_id (string) – the hash id of the host |
|---|
Gather the information required for updating the web interface.
| Parameters: |
|
|---|---|
| Returns: | The torrent and ui information. |
| Return type: | dictionary |
Decorator function to register an object’s method as a RPC. The object will need to be registered with a :class:JSON to be effective.
| Parameters: |
|
|---|