From be52bd17ea01d8c302e39ba444194de282dc4728 Mon Sep 17 00:00:00 2001 From: Christian Segundo Date: Sat, 10 Jun 2023 00:11:39 +0200 Subject: First commit --- scripts/ask-tracker-for-more-peers.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 scripts/ask-tracker-for-more-peers.py (limited to 'scripts/ask-tracker-for-more-peers.py') diff --git a/scripts/ask-tracker-for-more-peers.py b/scripts/ask-tracker-for-more-peers.py new file mode 100755 index 0000000..8b874f0 --- /dev/null +++ b/scripts/ask-tracker-for-more-peers.py @@ -0,0 +1,21 @@ +#!/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() -- cgit v1.2.3