Torrents

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

Implementation of all Torrents API methods.

torrents_add(urls=None, torrent_files=None, save_path=None, cookie=None, category=None, is_skip_checking=None, is_paused=None, is_root_folder=None, rename=None, upload_limit=None, download_limit=None, use_auto_torrent_management=None, is_sequential_download=None, is_first_last_piece_priority=None, **kwargs)

Add one or more torrents by URLs and/or torrent files.

Raises:
Parameters:
  • urls – single instance or an iterable of URLs (http://, https://, magnet: and bc://bt/)
  • torrent_files – several options are available to send torrent files to qBittorrent: 1) single instance of bytes: useful if torrent file already read from disk or downloaded from internet. 2) single instance of file handle to torrent file: use open(<filepath>, ‘rb’) to open the torrent file. 3) single instance of a filepath to torrent file: e.g. ‘/home/user/torrent_filename.torrent’ 4) an iterable of the single instances above to send more than one torrent file 5) dictionary with key/value pairs of torrent name and single instance of above object Note: The torrent name in a dictionary is useful to identify which torrent file errored. qBittorrent provides back that name in the error text. If a torrent name is not provided, then the name of the file will be used. And in the case of bytes (or if filename cannot be determined), the value ‘torrent__n’ will be used
  • save_path – location to save the torrent data
  • cookie – cookie to retrieve torrents by URL
  • category – category to assign to torrent(s)
  • is_skip_checking – skip hash checking
  • is_paused – True to start torrent(s) paused
  • is_root_folder – True or False to create root folder
  • rename – new name for torrent(s)
  • upload_limit – upload limit in bytes/second
  • download_limit – download limit in bytes/second
  • use_auto_torrent_management – True or False to use automatic torrent management
  • is_sequential_download – True or False for sequential download
  • is_first_last_piece_priority – True or False for first and last piece download priority
Returns:

“Ok.” for success and “Fails.” for failure

torrents_addPeers(peers=None, torrent_hashes=None, **kwargs)

Add one or more peers to one or more torrents. (alias: torrents_addPeers)

Raises:

InvalidRequest400Error – for invalid peers

Parameters:
  • peers – one or more peers to add. each peer should take the form ‘host:port’
  • torrent_hashes – single torrent hash or list of torrent hashes. Or ‘all’ for all torrents.
Returns:

dictionary - {<hash>: {‘added’: #, ‘failed’: #}}

torrents_addTags(tags=None, torrent_hashes=None, **kwargs)

Add one or more tags to one or more torrents. (alias: torrents_addTags) Note: Tags that do not exist will be created on-the-fly.

Parameters:
  • tags – tag name or list of tags
  • torrent_hashes – single torrent hash or list of torrent hashes. Or ‘all’ for all torrents.
Returns:

None

torrents_addTrackers(torrent_hash=None, urls=None, **kwargs)

Add trackers to a torrent. (alias: torrents_addTrackers)

Raises:

NotFound404Error

Parameters:
  • torrent_hash – hash for torrent
  • urls – tracker urls to add to torrent
Returns:

None

torrents_add_peers(peers=None, torrent_hashes=None, **kwargs)

Add one or more peers to one or more torrents. (alias: torrents_addPeers)

Raises:

InvalidRequest400Error – for invalid peers

Parameters:
  • peers – one or more peers to add. each peer should take the form ‘host:port’
  • torrent_hashes – single torrent hash or list of torrent hashes. Or ‘all’ for all torrents.
Returns:

dictionary - {<hash>: {‘added’: #, ‘failed’: #}}

torrents_add_tags(tags=None, torrent_hashes=None, **kwargs)

Add one or more tags to one or more torrents. (alias: torrents_addTags) Note: Tags that do not exist will be created on-the-fly.

Parameters:
  • tags – tag name or list of tags
  • torrent_hashes – single torrent hash or list of torrent hashes. Or ‘all’ for all torrents.
Returns:

None

torrents_add_trackers(torrent_hash=None, urls=None, **kwargs)

Add trackers to a torrent. (alias: torrents_addTrackers)

Raises:

NotFound404Error

Parameters:
  • torrent_hash – hash for torrent
  • urls – tracker urls to add to torrent
Returns:

None

torrents_bottomPrio(torrent_hashes=None, **kwargs)

Set torrent as highest priority. Torrent Queuing must be enabled. (alias: torrents_bottomPrio)

Raises:Conflict409
Parameters:torrent_hashes – single torrent hash or list of torrent hashes. Or ‘all’ for all torrents.
Returns:None
torrents_bottom_priority(torrent_hashes=None, **kwargs)

Set torrent as highest priority. Torrent Queuing must be enabled. (alias: torrents_bottomPrio)

Raises:Conflict409
Parameters:torrent_hashes – single torrent hash or list of torrent hashes. Or ‘all’ for all torrents.
Returns:None
torrents_categories(**kwargs)

Retrieve all category definitions

Note: torrents/categories is not available until v2.1.0 :return: dictionary of categories

torrents_createCategory(name=None, save_path=None, **kwargs)

Create a new torrent category. (alias: torrents_createCategory)

Note: save_path is not available until web API version 2.1.0

Raises:

Conflict409 – if category name is not valid or unable to create

Parameters:
  • name – name for new category
  • save_path – location to save torrents for this category
Returns:

None

torrents_createTags(tags=None, **kwargs)

Create one or more tags. (alias: torrents_createTags)

Parameters:tags – tag name or list of tags
Returns:None
torrents_create_category(name=None, save_path=None, **kwargs)

Create a new torrent category. (alias: torrents_createCategory)

Note: save_path is not available until web API version 2.1.0

Raises:

Conflict409 – if category name is not valid or unable to create

Parameters:
  • name – name for new category
  • save_path – location to save torrents for this category
Returns:

None

torrents_create_tags(tags=None, **kwargs)

Create one or more tags. (alias: torrents_createTags)

Parameters:tags – tag name or list of tags
Returns:None
torrents_decreasePrio(torrent_hashes=None, **kwargs)

Decrease the priority of a torrent. Torrent Queuing must be enabled. (alias: torrents_decreasePrio)

Raises:Conflict409
Parameters:torrent_hashes – single torrent hash or list of torrent hashes. Or ‘all’ for all torrents.
Returns:None
torrents_decrease_priority(torrent_hashes=None, **kwargs)

Decrease the priority of a torrent. Torrent Queuing must be enabled. (alias: torrents_decreasePrio)

Raises:Conflict409
Parameters:torrent_hashes – single torrent hash or list of torrent hashes. Or ‘all’ for all torrents.
Returns:None
torrents_delete(delete_files=None, torrent_hashes=None, **kwargs)

Remove a torrent from qBittorrent and optionally delete its files.

Parameters:
  • torrent_hashes – single torrent hash or list of torrent hashes. Or ‘all’ for all torrents.
  • delete_files – True to delete the torrent’s files
Returns:

None

torrents_deleteTags(tags=None, **kwargs)

Delete one or more tags. (alias: torrents_deleteTags)

Parameters:tags – tag name or list of tags
Returns:None
torrents_delete_tags(tags=None, **kwargs)

Delete one or more tags. (alias: torrents_deleteTags)

Parameters:tags – tag name or list of tags
Returns:None
torrents_downloadLimit(torrent_hashes=None, **kwargs)

Retrieve the download limit for one or more torrents. (alias: torrents_downloadLimit)

Returns:dictioanry {hash: limit} (-1 represents no limit)
torrents_download_limit(torrent_hashes=None, **kwargs)

Retrieve the download limit for one or more torrents. (alias: torrents_downloadLimit)

Returns:dictioanry {hash: limit} (-1 represents no limit)
torrents_editCategory(name=None, save_path=None, **kwargs)

Edit an existing category. (alias: torrents_editCategory)

Note: torrents/editCategory not available until web API version 2.1.0

Raises:

Conflict409

Parameters:
  • name – category to edit
  • save_path – new location to save files for this category
Returns:

None

torrents_editTracker(torrent_hash=None, original_url=None, new_url=None, **kwargs)

Replace a torrent’s tracker with a different one. (alias: torrents_editTrackers)

Raises:
Parameters:
  • torrent_hash – hash for torrent
  • original_url – URL for existing tracker
  • new_url – new URL to replace
Returns:

None

torrents_edit_category(name=None, save_path=None, **kwargs)

Edit an existing category. (alias: torrents_editCategory)

Note: torrents/editCategory not available until web API version 2.1.0

Raises:

Conflict409

Parameters:
  • name – category to edit
  • save_path – new location to save files for this category
Returns:

None

torrents_edit_tracker(torrent_hash=None, original_url=None, new_url=None, **kwargs)

Replace a torrent’s tracker with a different one. (alias: torrents_editTrackers)

Raises:
Parameters:
  • torrent_hash – hash for torrent
  • original_url – URL for existing tracker
  • new_url – new URL to replace
Returns:

None

torrents_filePrio(torrent_hash=None, file_ids=None, priority=None, **kwargs)

Set priority for one or more files. (alias: torrents_filePrio)

Raises:
  • InvalidRequest400 – if priority is invalid or at least one file ID is not an integer
  • NotFound404Error
  • Conflict409 – if torrent metadata has not finished downloading or at least one file was not found
Parameters:
Returns:

None

torrents_file_priority(torrent_hash=None, file_ids=None, priority=None, **kwargs)

Set priority for one or more files. (alias: torrents_filePrio)

Raises:
  • InvalidRequest400 – if priority is invalid or at least one file ID is not an integer
  • NotFound404Error
  • Conflict409 – if torrent metadata has not finished downloading or at least one file was not found
Parameters:
Returns:

None

torrents_files(torrent_hash=None, **kwargs)

Retrieve individual torrent’s files.

Raises:NotFound404Error
Parameters:torrent_hash – hash for torrent
Returns:List of torrent’s files Properties: https://github.com/qbittorrent/qBittorrent/wiki/WebUI-API-(qBittorrent-4.1)#get-torrent-contents
torrents_increasePrio(torrent_hashes=None, **kwargs)

Increase the priority of a torrent. Torrent Queuing must be enabled. (alias: torrents_increasePrio)

Raises:Conflict409
Parameters:torrent_hashes – single torrent hash or list of torrent hashes. Or ‘all’ for all torrents.
Returns:None
torrents_increase_priority(torrent_hashes=None, **kwargs)

Increase the priority of a torrent. Torrent Queuing must be enabled. (alias: torrents_increasePrio)

Raises:Conflict409
Parameters:torrent_hashes – single torrent hash or list of torrent hashes. Or ‘all’ for all torrents.
Returns:None
torrents_info(status_filter=None, category=None, sort=None, reverse=None, limit=None, offset=None, torrent_hashes=None, **kwargs)

Retrieves list of info for torrents. Note: hashes is available starting web API version 2.0.1

Parameters:
  • status_filter – Filter list by all, downloading, completed, paused, active, inactive, resumed stalled, stalled_uploading and stalled_downloading added in Web API v2.4.1
  • category – Filter list by category
  • sort – Sort list by any property returned
  • reverse – Reverse sorting
  • limit – Limit length of list
  • offset – Start of list (if < 0, offset from end of list)
  • torrent_hashes – Filter list by hash (separate multiple hashes with a ‘|’)
Returns:

List of torrents Properties: https://github.com/qbittorrent/qBittorrent/wiki/WebUI-API-(qBittorrent-4.1)#get-torrent-list

torrents_pause(torrent_hashes=None, **kwargs)

Pause one or more torrents in qBittorrent.

Parameters:torrent_hashes – single torrent hash or list of torrent hashes. Or ‘all’ for all torrents.
Returns:None
torrents_pieceHashes(torrent_hash=None, **kwargs)

Retrieve individual torrent’s pieces’ hashes. (alias: torrents_pieceHashes)

Raises:NotFound404Error
Parameters:torrent_hash – hash for torrent
Returns:List of torrent’s pieces’ hashes
torrents_pieceStates(torrent_hash=None, **kwargs)

Retrieve individual torrent’s pieces’ states. (alias: torrents_pieceStates)

Raises:NotFound404Error
Parameters:torrent_hash – hash for torrent
Returns:list of torrent’s pieces’ states
torrents_piece_hashes(torrent_hash=None, **kwargs)

Retrieve individual torrent’s pieces’ hashes. (alias: torrents_pieceHashes)

Raises:NotFound404Error
Parameters:torrent_hash – hash for torrent
Returns:List of torrent’s pieces’ hashes
torrents_piece_states(torrent_hash=None, **kwargs)

Retrieve individual torrent’s pieces’ states. (alias: torrents_pieceStates)

Raises:NotFound404Error
Parameters:torrent_hash – hash for torrent
Returns:list of torrent’s pieces’ states
torrents_properties(torrent_hash=None, **kwargs)

Retrieve individual torrent’s properties.

Raises:NotFound404Error
Parameters:torrent_hash – hash for torrent
Returns:Dictionary of torrent properties Properties: https://github.com/qbittorrent/qBittorrent/wiki/WebUI-API-(qBittorrent-4.1)#get-torrent-generic-properties
torrents_reannounce(torrent_hashes=None, **kwargs)

Reannounce a torrent.

Note: torrents/reannounce not available web API version 2.0.2

Parameters:torrent_hashes – single torrent hash or list of torrent hashes. Or ‘all’ for all torrents.
Returns:None
torrents_recheck(torrent_hashes=None, **kwargs)

Recheck a torrent in qBittorrent.

Parameters:torrent_hashes – single torrent hash or list of torrent hashes. Or ‘all’ for all torrents.
Returns:None
torrents_removeCategories(categories=None, **kwargs)

Delete one or more categories. (alias: torrents_removeCategories)

Parameters:categories – categories to delete
Returns:None
torrents_removeTags(tags=None, torrent_hashes=None, **kwargs)

Add one or more tags to one or more torrents. (alias: torrents_removeTags)

Parameters:
  • tags – tag name or list of tags
  • torrent_hashes – single torrent hash or list of torrent hashes. Or ‘all’ for all torrents.
Returns:

None

torrents_removeTrackers(torrent_hash=None, urls=None, **kwargs)

Remove trackers from a torrent. (alias: torrents_removeTrackers)

Raises:
Parameters:
  • torrent_hash – hash for torrent
  • urls – tracker urls to removed from torrent
Returns:

None

torrents_remove_categories(categories=None, **kwargs)

Delete one or more categories. (alias: torrents_removeCategories)

Parameters:categories – categories to delete
Returns:None
torrents_remove_tags(tags=None, torrent_hashes=None, **kwargs)

Add one or more tags to one or more torrents. (alias: torrents_removeTags)

Parameters:
  • tags – tag name or list of tags
  • torrent_hashes – single torrent hash or list of torrent hashes. Or ‘all’ for all torrents.
Returns:

None

torrents_remove_trackers(torrent_hash=None, urls=None, **kwargs)

Remove trackers from a torrent. (alias: torrents_removeTrackers)

Raises:
Parameters:
  • torrent_hash – hash for torrent
  • urls – tracker urls to removed from torrent
Returns:

None

torrents_rename(torrent_hash=None, new_torrent_name=None, **kwargs)

Rename a torrent.

Raises:

NotFound404Error

Parameters:
  • torrent_hash – hash for torrent
  • new_torrent_name – new name for torrent
Returns:

None

torrents_renameFile(torrent_hash=None, file_id=None, new_file_name=None, **kwargs)

Rename a torrent file.

Raises:
Parameters:
  • torrent_hash – hash for torrent
  • file_id – id for file
  • new_file_name – new name for file
Returns:

None

torrents_rename_file(torrent_hash=None, file_id=None, new_file_name=None, **kwargs)

Rename a torrent file.

Raises:
Parameters:
  • torrent_hash – hash for torrent
  • file_id – id for file
  • new_file_name – new name for file
Returns:

None

torrents_resume(torrent_hashes=None, **kwargs)

Resume one or more torrents in qBittorrent.

Parameters:torrent_hashes – single torrent hash or list of torrent hashes. Or ‘all’ for all torrents.
Returns:None
torrents_setAutoManagement(enable=None, torrent_hashes=None, **kwargs)

Enable or disable automatic torrent management for one or more torrents. (alias: torrents_setAutoManagement)

Parameters:
  • torrent_hashes – single torrent hash or list of torrent hashes. Or ‘all’ for all torrents.
  • enable – True or False
Returns:

None

torrents_setCategory(category=None, torrent_hashes=None, **kwargs)

Set a category for one or more torrents. (alias: torrents_setCategory)

Raises:

Conflict409 – for bad category

Parameters:
  • torrent_hashes – single torrent hash or list of torrent hashes. Or ‘all’ for all torrents.
  • category – category to assign to torrent
Returns:

None

torrents_setDownloadLimit(limit=None, torrent_hashes=None, **kwargs)

Set the download limit for one or more torrents. (alias: torrents_setDownloadLimit)

Parameters:
  • torrent_hashes – single torrent hash or list of torrent hashes. Or ‘all’ for all torrents.
  • limit – bytes/second (-1 sets the limit to infinity)
Returns:

None

torrents_setForceStart(enable=None, torrent_hashes=None, **kwargs)

Force start one or more torrents. (alias: torrents_setForceStart)

Parameters:
  • torrent_hashes – single torrent hash or list of torrent hashes. Or ‘all’ for all torrents.
  • enable – True or False (False makes this equivalent to torrents_resume())
Returns:

None

torrents_setLocation(location=None, torrent_hashes=None, **kwargs)

Set location for torrents’s files. (alias: torrents_setLocation)

Raises:
  • Forbidden403Error – if the user doesn’t have permissions to write to the location
  • Conflict409 – if the directory cannot be created at the location
Parameters:
  • torrent_hashes – single torrent hash or list of torrent hashes. Or ‘all’ for all torrents.
  • location – disk location to move torrent’s files
Returns:

None

torrents_setShareLimits(ratio_limit=None, seeding_time_limit=None, torrent_hashes=None, **kwargs)

Set share limits for one or more torrents.

Parameters:
  • torrent_hashes – single torrent hash or list of torrent hashes. Or ‘all’ for all torrents.
  • ratio_limit – max ratio to seed a torrent. (-2 means use the global value and -1 is no limit)
  • seeding_time_limit – minutes (-2 means use the global value and -1 is no limit)
Returns:

None

torrents_setSuperSeeding(enable=None, torrent_hashes=None, **kwargs)

Set one or more torrents as super seeding. (alias: torrents_setSuperSeeding)

Parameters:
  • torrent_hashes – single torrent hash or list of torrent hashes. Or ‘all’ for all torrents.
  • enable – True or False
Returns:

torrents_setUploadLimit(limit=None, torrent_hashes=None, **kwargs)

Set the upload limit for one or more torrents. (alias: torrents_setUploadLimit)

Parameters:
  • torrent_hashes – single torrent hash or list of torrent hashes. Or ‘all’ for all torrents.
  • limit – bytes/second (-1 sets the limit to infinity)
Returns:

None

torrents_set_auto_management(enable=None, torrent_hashes=None, **kwargs)

Enable or disable automatic torrent management for one or more torrents. (alias: torrents_setAutoManagement)

Parameters:
  • torrent_hashes – single torrent hash or list of torrent hashes. Or ‘all’ for all torrents.
  • enable – True or False
Returns:

None

torrents_set_category(category=None, torrent_hashes=None, **kwargs)

Set a category for one or more torrents. (alias: torrents_setCategory)

Raises:

Conflict409 – for bad category

Parameters:
  • torrent_hashes – single torrent hash or list of torrent hashes. Or ‘all’ for all torrents.
  • category – category to assign to torrent
Returns:

None

torrents_set_download_limit(limit=None, torrent_hashes=None, **kwargs)

Set the download limit for one or more torrents. (alias: torrents_setDownloadLimit)

Parameters:
  • torrent_hashes – single torrent hash or list of torrent hashes. Or ‘all’ for all torrents.
  • limit – bytes/second (-1 sets the limit to infinity)
Returns:

None

torrents_set_force_start(enable=None, torrent_hashes=None, **kwargs)

Force start one or more torrents. (alias: torrents_setForceStart)

Parameters:
  • torrent_hashes – single torrent hash or list of torrent hashes. Or ‘all’ for all torrents.
  • enable – True or False (False makes this equivalent to torrents_resume())
Returns:

None

torrents_set_location(location=None, torrent_hashes=None, **kwargs)

Set location for torrents’s files. (alias: torrents_setLocation)

Raises:
  • Forbidden403Error – if the user doesn’t have permissions to write to the location
  • Conflict409 – if the directory cannot be created at the location
Parameters:
  • torrent_hashes – single torrent hash or list of torrent hashes. Or ‘all’ for all torrents.
  • location – disk location to move torrent’s files
Returns:

None

torrents_set_share_limits(ratio_limit=None, seeding_time_limit=None, torrent_hashes=None, **kwargs)

Set share limits for one or more torrents.

Parameters:
  • torrent_hashes – single torrent hash or list of torrent hashes. Or ‘all’ for all torrents.
  • ratio_limit – max ratio to seed a torrent. (-2 means use the global value and -1 is no limit)
  • seeding_time_limit – minutes (-2 means use the global value and -1 is no limit)
Returns:

None

torrents_set_super_seeding(enable=None, torrent_hashes=None, **kwargs)

Set one or more torrents as super seeding. (alias: torrents_setSuperSeeding)

Parameters:
  • torrent_hashes – single torrent hash or list of torrent hashes. Or ‘all’ for all torrents.
  • enable – True or False
Returns:

torrents_set_upload_limit(limit=None, torrent_hashes=None, **kwargs)

Set the upload limit for one or more torrents. (alias: torrents_setUploadLimit)

Parameters:
  • torrent_hashes – single torrent hash or list of torrent hashes. Or ‘all’ for all torrents.
  • limit – bytes/second (-1 sets the limit to infinity)
Returns:

None

torrents_tags(**kwargs)

Retrieve all tag definitions.

Returns:list of tags
torrents_toggleFirstLastPiecePrio(torrent_hashes=None, **kwargs)

Toggle priority of first/last piece downloading. (alias: torrents_toggleFirstLastPiecePrio)

Parameters:torrent_hashes – single torrent hash or list of torrent hashes. Or ‘all’ for all torrents.
Returns:None
torrents_toggleSequentialDownload(torrent_hashes=None, **kwargs)

Toggle sequential download for one or more torrents. (alias: torrents_toggleSequentialDownload)

Parameters:torrent_hashes – single torrent hash or list of torrent hashes. Or ‘all’ for all torrents.
Returns:None
torrents_toggle_first_last_piece_priority(torrent_hashes=None, **kwargs)

Toggle priority of first/last piece downloading. (alias: torrents_toggleFirstLastPiecePrio)

Parameters:torrent_hashes – single torrent hash or list of torrent hashes. Or ‘all’ for all torrents.
Returns:None
torrents_toggle_sequential_download(torrent_hashes=None, **kwargs)

Toggle sequential download for one or more torrents. (alias: torrents_toggleSequentialDownload)

Parameters:torrent_hashes – single torrent hash or list of torrent hashes. Or ‘all’ for all torrents.
Returns:None
torrents_topPrio(torrent_hashes=None, **kwargs)

Set torrent as highest priority. Torrent Queuing must be enabled. (alias: torrents_topPrio)

Raises:Conflict409
Parameters:torrent_hashes – single torrent hash or list of torrent hashes. Or ‘all’ for all torrents.
Returns:None
torrents_top_priority(torrent_hashes=None, **kwargs)

Set torrent as highest priority. Torrent Queuing must be enabled. (alias: torrents_topPrio)

Raises:Conflict409
Parameters:torrent_hashes – single torrent hash or list of torrent hashes. Or ‘all’ for all torrents.
Returns:None
torrents_trackers(torrent_hash=None, **kwargs)

Retrieve individual torrent’s trackers.

Raises:NotFound404Error
Parameters:torrent_hash – hash for torrent
Returns:List of torrent’s trackers Properties: https://github.com/qbittorrent/qBittorrent/wiki/WebUI-API-(qBittorrent-4.1)#get-torrent-trackers
torrents_uploadLimit(torrent_hashes=None, **kwargs)

Retrieve the upload limit for one or more torrents. (alias: torrents_uploadLimit)

Parameters:torrent_hashes – single torrent hash or list of torrent hashes. Or ‘all’ for all torrents.
Returns:dictionary of limits
torrents_upload_limit(torrent_hashes=None, **kwargs)

Retrieve the upload limit for one or more torrents. (alias: torrents_uploadLimit)

Parameters:torrent_hashes – single torrent hash or list of torrent hashes. Or ‘all’ for all torrents.
Returns:dictionary of limits
torrents_webseeds(torrent_hash=None, **kwargs)

Retrieve individual torrent’s web seeds.

Raises:NotFound404Error
Parameters:torrent_hash – hash for torrent
Returns:List of torrent’s web seeds Properties: https://github.com/qbittorrent/qBittorrent/wiki/WebUI-API-(qBittorrent-4.1)#get-torrent-web-seeds
class qbittorrentapi.Torrents(client)

Allows interaction with the “Torrents” 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 'torrents_' prepended)
>>> torrent_list = client.torrents.info()
>>> torrent_list_active = client.torrents.info.active()
>>> torrent_list_active_partial = client.torrents.info.active(limit=100, offset=200)
>>> torrent_list_downloading = client.torrents.info.downloading()
>>> # torrent looping
>>> for torrent in client.torrents.info.completed()
>>> # all torrents endpoints with a 'hashes' parameters support all method to apply action to all torrents
>>> client.torrents.pause.all()
>>> client.torrents.resume.all()
>>> # or specify the individual hashes
>>> client.torrents.downloadLimit(torrent_hashes=['...', '...'])
add(urls=None, torrent_files=None, save_path=None, cookie=None, category=None, is_skip_checking=None, is_paused=None, is_root_folder=None, rename=None, upload_limit=None, download_limit=None, use_auto_torrent_management=None, is_sequential_download=None, is_first_last_piece_priority=None, **kwargs)
class qbittorrentapi.TorrentDictionary(data, client)

Alows interaction with individual torrents via the “Torrents” 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 'transfer_' prepended)
>>> torrent = client.torrents.info()[0]
>>> torrent_hash = torrent.info.hash
>>> # Attributes without inputs and a return value are properties
>>> properties = torrent.properties
>>> trackers = torrent.trackers
>>> files = torrent.files
>>> # Action methods
>>> torrent.edit_tracker(original_url="...", new_url="...")
>>> torrent.remove_trackers(urls='http://127.0.0.2/')
>>> torrent.rename(new_torrent_name="...")
>>> torrent.resume()
>>> torrent.pause()
>>> torrent.recheck()
>>> torrent.torrents_top_priority()
>>> torrent.setLocation(location='/home/user/torrents/')
>>> torrent.setCategory(category='video')
addTags(tags=None, **kwargs)
addTrackers(urls=None, **kwargs)
add_tags(tags=None, **kwargs)
add_trackers(urls=None, **kwargs)
bottomPrio(**kwargs)
bottom_priority(**kwargs)
decreasePrio(**kwargs)
decrease_priority(**kwargs)
delete(delete_files=None, **kwargs)
downloadLimit
download_limit
editTracker(orig_url=None, new_url=None, **kwargs)
edit_tracker(orig_url=None, new_url=None, **kwargs)
filePriority(file_ids=None, priority=None, **kwargs)
file_priority(file_ids=None, priority=None, **kwargs)
files
increasePrio(**kwargs)
increase_priority(**kwargs)
info
pause(**kwargs)
pieceHashes
pieceStates
piece_hashes
piece_states
properties
reannounce(**kwargs)
recheck(**kwargs)
removeTags(tags=None, **kwargs)
removeTrackers(urls=None, **kwargs)
remove_tags(tags=None, **kwargs)
remove_trackers(urls=None, **kwargs)
rename(new_name=None, **kwargs)
renameFile(file_id=None, new_file_name=None, **kwargs)
rename_file(file_id=None, new_file_name=None, **kwargs)
resume(**kwargs)
setAutoManagement(enable=None, **kwargs)
setCategory(category=None, **kwargs)
setDownloadLimit(limit=None, **kwargs)
setForceStart(enable=None, **kwargs)
setLocation(location=None, **kwargs)
setShareLimits(ratio_limit=None, seeding_time_limit=None, **kwargs)
setSuperSeeding(enable=None, **kwargs)
setUploadLimit(limit=None, **kwargs)
set_auto_management(enable=None, **kwargs)
set_category(category=None, **kwargs)
set_download_limit(limit=None, **kwargs)
set_force_start(enable=None, **kwargs)
set_location(location=None, **kwargs)
set_share_limits(ratio_limit=None, seeding_time_limit=None, **kwargs)
set_super_seeding(enable=None, **kwargs)
set_upload_limit(limit=None, **kwargs)
state_enum

Returns the formalized Enumeration for Torrent State instead of the raw string.

sync_local()

Update local cache of torrent info.

toggleFirstLastPiecePrio(**kwargs)
toggleSequentialDownload(**kwargs)
toggle_first_last_piece_priority(**kwargs)
toggle_sequential_download(**kwargs)
topPrio(**kwargs)
top_priority(**kwargs)
trackers
uploadLimit
upload_limit
webseeds