Sync

class SyncAPIMixIn(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 Sync API Methods.

Usage:
>>> from qbittorrentapi import Client
>>> client = Client(host="localhost:8080", username="admin", password="adminadmin")
>>> maindata = client.sync_maindata(rid="...")
>>> torrent_peers = client.sync_torrent_peers(torrent_hash="...", rid="...")
sync_maindata(rid=0, **kwargs) SyncMainDataDictionary

Retrieves sync data.

Parameters:

rid (str | int) – response ID

Return type:

SyncMainDataDictionary

sync_torrent_peers(torrent_hash=None, rid=0, **kwargs) SyncTorrentPeersDictionary

Retrieves torrent sync data.

Raises:

NotFound404Error

Parameters:
  • torrent_hash (str | None) – hash for torrent

  • rid (str | int) – response ID

Return type:

SyncTorrentPeersDictionary

class Sync(client) None

Allows interaction with the Sync 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 'sync_' prepended)
>>> maindata = client.sync.maindata(rid="...")
>>> # for use when continuously calling maindata for changes in torrents
>>> # this will automatically request the changes since the last call
>>> md = client.sync.maindata.delta()
>>> #
>>> torrentPeers = client.sync.torrentPeers(torrent_hash="...", rid="...")
>>> torrent_peers = client.sync.torrent_peers(torrent_hash="...", rid="...")
class MainData(client) None
__call__(rid=0, **kwargs) SyncMainDataDictionary

Call self as a function.

Return type:

SyncMainDataDictionary

delta(**kwargs) SyncMainDataDictionary

Implements sync_maindata() to return updates since last call.

Return type:

SyncMainDataDictionary

reset_rid() None

Resets RID so the next request includes everything.

Return type:

None

class TorrentPeers(client) None
__call__(torrent_hash=None, rid=0, **kwargs) SyncTorrentPeersDictionary

Implements sync_torrent_peers().

Return type:

SyncTorrentPeersDictionary

delta(torrent_hash=None, **kwargs) SyncTorrentPeersDictionary

Implements sync_torrent_peers() to return updates since last call.

Return type:

SyncTorrentPeersDictionary

reset_rid() None

Resets RID so the next request includes everything.

Return type:

None

property maindata: MainData

Implements sync_maindata().

property torrentPeers: TorrentPeers

Implements sync_torrent_peers().

property torrent_peers: TorrentPeers

Implements sync_torrent_peers().

class SyncMainDataDictionary(data=None, **kwargs)

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

Response for sync_maindata()

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

class SyncTorrentPeersDictionary(data=None, **kwargs)

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

Response for sync_torrent_peers()

Definition: https://github.com/qbittorrent/qBittorrent/wiki/WebUI-API-(qBittorrent-5.0)#user-content-get-torrent-peers-data