docs(torrent_api): readme
Torrent API CI / test (push) Failing after 9s
Torrent API CI / lint (push) Failing after 7s
Torrent API CI / build (push) Skipped
Torrent API CI / install (mediahost) (push) Skipped
Torrent API CI / install (quiethost) (push) Skipped
Torrent API CI / install (serverhost) (push) Skipped
Torrent API CI / install (vivohost) (push) Skipped

This commit is contained in:
Lucas Vivo committed 2026-11-23 11:36:36 +01:00
1 parent fbb5efa838
commit 5d026332c0
1 file changed
+9 -7
+9 -7
View File
@@ -3,7 +3,7 @@
Install the package and its dependencies in your virtual environment: Install the package and its dependencies in your virtual environment:
```sh ```sh
python -m pip install -e . uv sync --project .
``` ```
Use the `Qbittorrent` class: Use the `Qbittorrent` class:
@@ -15,14 +15,14 @@ instance = Qbittorrent("localhost:8080", "example", "your-api-key")
# Either limit may be omitted. Seed time is measured in seconds. # Either limit may be omitted. Seed time is measured in seconds.
removed = instance.remove_torrents(seed_time=7 * 86400, ratio=2.0) removed = instance.remove_torrents(seed_time=7 * 86400, ratio=2.0)
instance.get_torrent_contents("exact torrent name or hash") instance.show_and_copy_torrent_contents("exact torrent name or hash")
instance.show_torrents(id=True) # Include torrent hashes in the listing. instance.show_torrents(id=True) # Include torrent hashes in the listing.
``` ```
`remove_torrents` removes torrents exceeding either limit and deletes their `remove_torrents` removes torrents exceeding either limit and deletes their
downloaded files by default. Pass `delete_files=False` to retain the files. It downloaded files by default. Pass `delete_files=False` to retain the files. It
returns the matching torrent records after a successful deletion. returns the matching torrent records after a successful deletion.
`get_torrent_contents` prints files whose progress meets the threshold `show_and_copy_torrent_contents` prints files whose progress meets the threshold
(default: 1.0). Pass `copy_to` with a destination directory to also copy files (default: 1.0). Pass `copy_to` with a destination directory to also copy files
that are 100% complete there, preserving their torrent-relative paths. Names that are 100% complete there, preserving their torrent-relative paths. Names
must match exactly; use the hash if multiple torrents have the same name. must match exactly; use the hash if multiple torrents have the same name.
@@ -41,9 +41,11 @@ torrent-api
``` ```
The CLI uses the existing private and public instance addresses and supports The CLI uses the existing private and public instance addresses and supports
`--log-level` (TRACE, DEBUG, INFO, WARNING, ERROR, or CRITICAL; default INFO),
`--sort`, `--asc`, `--force-start`, `--show-id`, `--id` (torrent name or hash `--sort`, `--asc`, `--force-start`, `--show-id`, `--id` (torrent name or hash
for contents), `--progress-threshold`, and `--copy-to` (a destination directory for contents), `--progress-threshold`, and `--copy-to` (a destination directory
for completed files). The VS Code launch configuration for completed files). Add `--dry-run` to log planned copies without writing
files. The VS Code launch configuration
uses the workspace `main.py` and loads `.env` automatically. Keep this file uses the workspace `main.py` and loads `.env` automatically. Keep this file
private; it is ignored by Git. private; it is ignored by Git.
@@ -59,9 +61,9 @@ installed package is selected.
Install the optional tools and build a single-file executable: Install the optional tools and build a single-file executable:
```sh ```sh
python -m pip install -e '.[build,lint]' uv sync --project . --extra build --extra lint
ruff check src tests main.py run_tests.py uv run --project . ruff check src tests main.py run_tests.py
python -m PyInstaller --noconfirm torrent_api.spec uv run --project . python -m PyInstaller --noconfirm torrent_api.spec
./dist/torrent_api --help ./dist/torrent_api --help
``` ```