From 912edc250012dba5f7d3d7c2cc0ef54d8e31011d Mon Sep 17 00:00:00 2001 From: Jeffrey Serio Date: Fri, 25 Oct 2024 11:56:21 -0500 Subject: [PATCH] Add ssv support --- list_torrents.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/list_torrents.py b/list_torrents.py index 95505fe..7c35777 100755 --- a/list_torrents.py +++ b/list_torrents.py @@ -61,6 +61,15 @@ def print_table(): print(tabulate(table, headers, tablefmt="grid")) +def print_ssv(): + qb = Client("http://localhost:8080/") + qb.login() + sorted_torrents = sorted(qb.torrents(), key=lambda d: d["name"]) # type: ignore + print("Name Size Trackers Ratio Uploaded") + for torrent in sorted_torrents: + print(f"{torrent["name"]} {human_bytes(int(torrent["total_size"]))} {torrent["trackers_count"]} {torrent["ratio"]} {human_bytes(int(torrent["uploaded"]))}") # type: ignore + + if __name__ == "__main__": args = docopt(__doc__) # type: ignore - print_table() + print_ssv()