Sync

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

Implementation of all Sync API Methods.

sync_maindata(rid=0, **kwargs)

Retrieves sync data.

Parameters:rid – response ID
Returns:dictionary response Properties: https://github.com/qbittorrent/qBittorrent/wiki/WebUI-API-(qBittorrent-4.1)#get-main-data
sync_torrentPeers(torrent_hash=None, rid=0, **kwargs)

Retrieves torrent sync data. (alias: sync_torrentPeers)

Raises:

NotFound404Error

Parameters:
  • torrent_hash – hash for torrent
  • rid – response ID
Returns:

Dictionary of torrent sync data. Properties: https://github.com/qbittorrent/qBittorrent/wiki/WebUI-API-(qBittorrent-4.1)#get-torrent-peers-data

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

Retrieves torrent sync data. (alias: sync_torrentPeers)

Raises:

NotFound404Error

Parameters:
  • torrent_hash – hash for torrent
  • rid – response ID
Returns:

Dictionary of torrent sync data. Properties: https://github.com/qbittorrent/qBittorrent/wiki/WebUI-API-(qBittorrent-4.1)#get-torrent-peers-data

class qbittorrentapi.Sync(client)

Alows interaction with the “Sync” API endpoints.

Usage:
>>> from qbittorrentapi import Client
>>> client = Client(host='localhost:8080', username='admin', password='adminadmin')
>>> # this 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(hash="...'", rid='...')
>>> torrent_peers = client.sync.torrent_peers(hash="...'", rid='...')