#!/usr/bin/env python3 import click from transmission_rpc import Client @click.command() @click.option('--port', default=9091) @click.option('--host', default="localhost") def main(host, port): """ Reannounces all torrents that have not received any peers. """ c = Client(host=host, port=port) torrents = c.get_torrents() for torrent in torrents: if torrent.progress == 0 and torrent.downloading: print(f"Reannouncing {torrent.name}") c.reannounce_torrent(torrent.id) if __name__ == '__main__': main()