aboutsummaryrefslogtreecommitdiff
path: root/scripts/ask-tracker-for-more-peers.py
diff options
context:
space:
mode:
authorChristian Segundo2023-06-10 00:11:39 +0200
committerChristian Segundo2023-06-10 00:11:39 +0200
commitbe52bd17ea01d8c302e39ba444194de282dc4728 (patch)
treeb1d69842363bce20f3b3141b529b52877dfdbbd7 /scripts/ask-tracker-for-more-peers.py
downloadtransmission-hacks-be52bd17ea01d8c302e39ba444194de282dc4728.tar.gz
First commit
Diffstat (limited to 'scripts/ask-tracker-for-more-peers.py')
-rwxr-xr-xscripts/ask-tracker-for-more-peers.py21
1 files changed, 21 insertions, 0 deletions
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()