mirror of
https://codeberg.org/hyperreal/admin-scripts
synced 2024-11-01 16:03:06 +01:00
Add ssv support
This commit is contained in:
parent
e8428f1236
commit
912edc2500
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user