Transfer

class TransferAPIMixIn(host=None, port=None, username=None, password=None, api_key=None, EXTRA_HEADERS=None, REQUESTS_ARGS=None, HTTPADAPTER_ARGS=None, VERIFY_WEBUI_CERTIFICATE=True, FORCE_SCHEME_FROM_HOST=False, RAISE_NOTIMPLEMENTEDERROR_FOR_UNIMPLEMENTED_API_ENDPOINTS=False, RAISE_ERROR_FOR_UNSUPPORTED_QBITTORRENT_VERSIONS=False, VERBOSE_RESPONSE_LOGGING=False, SIMPLE_RESPONSES=False, DISABLE_LOGGING_DEBUG_OUTPUT=False) None

Bases: AppAPIMixIn

Implementation of all Transfer API methods.

Usage:
>>> from qbittorrentapi import Client
>>> client = Client(host="localhost:8080", username="admin", password="adminadmin")
>>> transfer_info = client.transfer_info()
>>> client.transfer_set_download_limit(limit=1024000)
transfer_ban_peers(peers=None, **kwargs) None

Ban one or more peers.

This method was introduced with qBittorrent v4.2.0 (Web API v2.3.0).

Parameters:

peers (str | Iterable[str] | None) – one or more peers to ban. each peer should take the form ‘host:port’

Return type:

None

transfer_download_limit(**kwargs) int

Retrieves download limit; 0 is unlimited.

Return type:

int

transfer_info(**kwargs) TransferInfoDictionary

Retrieves the global transfer info found in qBittorrent status bar.

Return type:

TransferInfoDictionary

transfer_setSpeedLimitsMode(intended_state=None, **kwargs) None

Sets whether alternative speed limits are enabled.

Parameters:

intended_state (bool | None) – True to enable alt speed and False to disable. Leaving None will toggle the current state.

Return type:

None

transfer_set_download_limit(limit=None, **kwargs) None

Set the global download limit in bytes/second.

Parameters:

limit (str | int | None) – download limit in bytes/second (0 or -1 for no limit)

Return type:

None

transfer_set_speed_limits_mode(intended_state=None, **kwargs) None

Sets whether alternative speed limits are enabled.

Parameters:

intended_state (bool | None) – True to enable alt speed and False to disable. Leaving None will toggle the current state.

Return type:

None

transfer_set_upload_limit(limit=None, **kwargs) None

Set the global download limit in bytes/second.

Parameters:

limit (str | int | None) – upload limit in bytes/second (0 or -1 for no limit)

Return type:

None

transfer_speed_limits_mode(**kwargs) str

Returns 1 if alternative speed limits are currently enabled, 0 otherwise.

Return type:

str

transfer_toggle_speed_limits_mode(intended_state=None, **kwargs) None

Sets whether alternative speed limits are enabled.

Parameters:

intended_state (bool | None) – True to enable alt speed and False to disable. Leaving None will toggle the current state.

Return type:

None

transfer_upload_limit(**kwargs) int

Retrieves upload limit; 0 is unlimited.

Return type:

int

class Transfer(*args, client, **kwargs)

Allows interaction with the Transfer API endpoints.

Usage:
>>> from qbittorrentapi import Client
>>> client = Client(host="localhost:8080", username="admin", password="adminadmin")
>>> # these are all the same attributes that are available as named in the
>>> #  endpoints or the more pythonic names in Client (with or without 'transfer_' prepended)
>>> transfer_info = client.transfer.info
>>> # access and set download/upload limits as attributes
>>> dl_limit = client.transfer.download_limit
>>> # this updates qBittorrent in real-time
>>> client.transfer.download_limit = 1024000
>>> # update speed limits mode to alternate or not
>>> client.transfer.speedLimitsMode = True
ban_peers(peers=None, **kwargs) None

Implements transfer_ban_peers().

Return type:

None

property download_limit: int

Implements transfer_download_limit().

property info: TransferInfoDictionary

Implements transfer_info().

set_download_limit(limit=None, **kwargs) None

Implements transfer_set_download_limit().

Return type:

None

set_speed_limits_mode(intended_state=None, **kwargs) None

Implements transfer_set_speed_limits_mode().

Return type:

None

set_upload_limit(limit=None, **kwargs) None

Implements transfer_set_upload_limit().

Return type:

None

property speed_limits_mode: str

Implements transfer_speed_limits_mode().

toggle_speed_limits_mode(intended_state=None, **kwargs) None

Implements transfer_set_speed_limits_mode().

Return type:

None

property upload_limit: int

Implements transfer_upload_limit().

class TransferInfoDictionary(data=None, **kwargs)

Bases: Dictionary[None | int | str | bool | Sequence[JsonValueT] | Mapping[str, JsonValueT]]

Response to transfer_info()

Definition: https://github.com/qbittorrent/qBittorrent/wiki/WebUI-API-(qBittorrent-5.0)#user-content-get-global-transfer-info