Sync#

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

Bases: qbittorrentapi.app.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)#

Retrieves sync data.

Parameters

rid – response ID

Returns

SyncMainDataDictionary - https://github.com/qbittorrent/qBittorrent/wiki/WebUI-API-(qBittorrent-4.1)#get-main-data

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

Retrieves torrent sync data.

Raises

NotFound404Error

Parameters
  • torrent_hash – hash for torrent

  • rid – response ID

Returns

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

class qbittorrentapi.sync.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='...')
class qbittorrentapi.sync.SyncMainDataDictionary(data=None, client=None)#

Bases: qbittorrentapi.definitions.Dictionary

Response for sync_maindata()

class qbittorrentapi.sync.SyncTorrentPeersDictionary(data=None, client=None)#

Bases: qbittorrentapi.definitions.Dictionary

Response for sync_torrent_peers()