Torrent Creator¶
- class TorrentCreatorAPIMixIn(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:
AppAPIMixInImplementation of all
TorrentCreatorAPI methods.- Usage:
>>> from qbittorrentapi import Client >>> client = Client(host="localhost:8080", username="admin", password="adminadmin") >>> task = client.torrentcreator_add_task(source_path="/path/to/data") >>> if TaskStatus(task.status().status) == TaskStatus.FINISHED: >>> torrent_data = task.torrent_file() >>> task.delete() >>> # or >>> client.torrentcreator_delete_task(task_id=task.taskID)
- torrentcreator_add_task(source_path=None, torrent_file_path=None, format=None, start_seeding=None, is_private=None, optimize_alignment=None, padded_file_size_limit=None, piece_size=None, comment=None, trackers=None, url_seeds=None, **kwargs) TorrentCreatorTaskDictionary¶
Add a task to create a new torrent.
This method was introduced with qBittorrent v5.0.0 (Web API v2.10.4).
- Raises:
Conflict409Error – too many existing torrent creator tasks
- Parameters:
source_path (
str|PathLike[Any] |None) – source file path for torrent contenttorrent_file_path (
str|PathLike[Any] |None) – file path to save torrentformat (
Literal['v1','v2','hybrid'] |None) – BitTorrent V1 or V2; defaults to “hybrid” format if Nonestart_seeding (
bool|None) – should qBittorrent start seeding this torrent?optimize_alignment (
bool|None) – should optimized alignment be enforced for new torrent?padded_file_size_limit (
int|None) – size limit for padding filesurl_seeds (
str|list[str] |None) – list of URLs seeds to add
- Return type:
- torrentcreator_delete_task(task_id=None, **kwargs) None¶
Delete a torrent creation task.
This method was introduced with qBittorrent v5.0.0 (Web API v2.10.4).
- Raises:
NotFound404Error – task not found
- Parameters:
- Return type:
- torrentcreator_status(task_id=None, **kwargs) TorrentCreatorTaskStatusList¶
Status for a torrent creation task.
This method was introduced with qBittorrent v5.0.0 (Web API v2.10.4).
- Raises:
NotFound404Error – task not found
- Parameters:
- Return type:
- torrentcreator_torrent_file(task_id=None, **kwargs) bytes¶
Retrieve torrent file for created torrent.
This method was introduced with qBittorrent v5.0.0 (Web API v2.10.4).
- Raises:
NotFound404Error – task not found
Conflict409Error – torrent creation is not finished or failed
- Parameters:
- Return type:
- class TorrentCreator(*args, client, **kwargs)¶
Allows interaction with
TorrentCreatorAPI endpoints.- Usage:
>>> from qbittorrentapi import Client >>> client = Client(host="localhost:8080", username="admin", password="adminadmin") >>> # this is all the same attributes that are available as named in the >>> # endpoints or the more pythonic names in Client (with or without 'torrentcreator_' prepended) >>> task = client.torrentcreator.add_task(source_path="/path/to/data") >>> if TaskStatus(task.status().status) == TaskStatus.FINISHED: >>> torrent_data = task.torrent_file() >>> task.delete() >>> # or >>> client.torrentcreator.delete_task(task_id=task.taskID)
- add_task(source_path=None, torrent_file_path=None, format=None, start_seeding=None, is_private=None, optimize_alignment=None, padded_file_size_limit=None, piece_size=None, comment=None, trackers=None, url_seeds=None, **kwargs) TorrentCreatorTaskDictionary¶
Implements
torrentcreator_add_task().- Return type:
- delete_task(task_id=None, **kwargs) None¶
Implements
torrentcreator_delete_task().- Return type:
- status(task_id=None, **kwargs) TorrentCreatorTaskStatusList¶
Implements
torrentcreator_status().- Return type:
- torrent_file(task_id=None, **kwargs) bytes¶
Implements
torrentcreator_torrent_file().- Return type:
- class TorrentCreatorTaskDictionary(data, client)¶
Bases:
ClientCache[TorrentCreatorAPIMixIn],Dictionary[None|int|str|bool|Sequence[JsonValueT] |Mapping[str, JsonValueT]]Response for
torrentcreator_add_task()- delete(**kwargs) None¶
Implements
torrentcreator_delete_task().- Return type:
- status(**kwargs) TorrentCreatorTaskStatus¶
Implements
torrentcreator_status().- Return type:
- torrent_file(**kwargs) bytes¶
Implements
torrentcreator_torrent_file().- Return type:
- class TorrentCreatorTaskStatus(data=None, **kwargs)¶
Bases:
ListEntryItem in
TorrentCreatorTaskStatusListDefinition: not documented…yet
- class TaskStatus(*values)¶
Bases:
EnumEnumeration of possible task statuses.
- FAILED = 'Failed'¶
- FINISHED = 'Finished'¶
- QUEUED = 'Queued'¶
- RUNNING = 'Running'¶
- class TorrentCreatorTaskStatusList(list_entries, client=None)¶
Bases:
List[TorrentCreatorTaskStatus]Response for
torrentcreator_status()