DelugeRPC is a protocol used for daemon/client communication. There are four types of messages involved in the protocol: RPC Request, RPC Response, RPC Error and Event. All messages are zlib compressed rencoded strings and their data formats are detailed below.
This message is created and sent by the client to the server requesting that a remote method be called. Multiple requests can be bundled in a list.
[[request_id, method, [args], {kwargs}], ...]
This message is created and sent in response to a RPC Request from a client. It will hold the return value of the requested method call. In the case of an error, a RPC Error message will be sent instead.
[message_type, request_id, [return_value]]
This message is created in response to an error generated while processing a RPC Request and will serve as a replacement for a RPC Response message.
[message_type, request_id, exception_type, exception_msg, traceback]
This message is created by the daemon and sent to the clients without being in response to a RPC Request. Events are generally sent for changes in the daemon’s state that the clients need to be made aware of.
[message_type, event_name, data]
Methods available in core
Adds a torrent file to the session.
| Parameters: |
|
|---|---|
| Returns: | the torrent_id as a str or None |
Adds a torrent from a magnet link.
| Parameters: |
|
|---|
Adds a torrent from a url. Deluge will attempt to fetch the torrent from url prior to adding it to the session.
| Parameters: |
|
|---|---|
| Returns: | the torrent_id as a str or None, if calling locally, then it will return a Deferred that fires once the torrent has been added |
Returns a dictionary of the session’s cache status.
| Returns: | a dict of the cache status |
|---|
Gets the session status values for ‘keys’
| Parameter: | keys – list of strings, the keys for which we want values |
|---|---|
| Returns: | a dictionary of {key: value, ...} |
| Return type: | dict |