diff --git a/torrent_api/README.md b/torrent_api/README.md index 273528b..bb5d975 100644 --- a/torrent_api/README.md +++ b/torrent_api/README.md @@ -3,7 +3,7 @@ Install the package and its dependencies in your virtual environment: ```sh -python -m pip install -e . +uv sync --project . ``` 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. 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. ``` `remove_torrents` removes torrents exceeding either limit and deletes their downloaded files by default. Pass `delete_files=False` to retain the files. It 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 that are 100% complete there, preserving their torrent-relative paths. Names 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 +`--log-level` (TRACE, DEBUG, INFO, WARNING, ERROR, or CRITICAL; default INFO), `--sort`, `--asc`, `--force-start`, `--show-id`, `--id` (torrent name or hash 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 private; it is ignored by Git. @@ -59,9 +61,9 @@ installed package is selected. Install the optional tools and build a single-file executable: ```sh -python -m pip install -e '.[build,lint]' -ruff check src tests main.py run_tests.py -python -m PyInstaller --noconfirm torrent_api.spec +uv sync --project . --extra build --extra lint +uv run --project . ruff check src tests main.py run_tests.py +uv run --project . python -m PyInstaller --noconfirm torrent_api.spec ./dist/torrent_api --help ```