Client

class qbittorrentapi.Client(host='', port=None, username=None, password=None, **kwargs)

Initialize API for qBittorrent client.

Host must be specified. Username and password can be specified at login. A call to auth_log_in is not explicitly required if username and password are provided during Client construction.

Parameters:
  • host – hostname for qBittorrent Web API (e.g. [http[s]://]localhost[:8080])
  • port – port number for qBittorrent Web API (note: only used if host does not contain a port)
  • username – user name for qBittorrent client
  • password – password for qBittorrent client
  • SIMPLE_RESPONSES – By default, complex objects are returned from some endpoints. These objects will allow for accessing responses’ items as attributes and include methods for contextually relevant actions. This comes at the cost of performance. Generally, this cost isn’t large; however, some endpoints, such as torrents_files() method, may need to convert a large payload. Set this to True to return the simple JSON back. Alternatively, set this to True only for an individual method call. For instance, when requesting the files for a torrent: client.torrents_files(hash=’…’, SIMPLE_RESPONSES=True).
  • VERIFY_WEBUI_CERTIFICATE – Set to False to skip verify certificate for HTTPS connections; for instance, if the connection is using a self-signed certificate. Not setting this to False for self-signed certs will cause a APIConnectionError exception to be raised.
  • RAISE_NOTIMPLEMENTEDERROR_FOR_UNIMPLEMENTED_API_ENDPOINTS – Some Endpoints may not be implemented in older versions of qBittorrent. Setting this to True will raise a NotImplementedError instead of just returning None.
  • DISABLE_LOGGING_DEBUG_OUTPUT – Turn off debug output from logging for this package as well as Requests & urllib3.