Skip to content

Commit f6a7586

Browse files
authored
Merge pull request blind-oracle#19 from mehulboricha/master
Automatically Reannounce Torrent & Cronjob Support
2 parents 737683e + fb41bf0 commit f6a7586

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,8 @@ Usage:
2828
* Adjust other parameters if needed (see comments)
2929
* Make the script run by cron e.g. every minute
3030
* You're done
31+
32+
Cron Setup:
33+
* Open Crontab using crontab -e
34+
* For Updating Trackers to Every New Torrent Every 15 Minutes Add: */15 * * * * /usr/bin/sh [path]]/transmission-trackers-auto-cron.sh
35+
* Modify the transmission-trackers-auto.sh file as per your needs. We have provided two options, transmission-daemon & docker

transmission-trackers-auto-cron.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
3+
# If you are using transmission-daemon directly on system the below code will ensure that trackers script run only when it is running
4+
if [ "$(systemctl is-active transmission-daemon)" = "active" ]
5+
then
6+
/usr/bin/python3 [path]]/transmission-trackers.py
7+
fi
8+
9+
# If you are using docker for transmission use the following. Replace 'docker-container-name' with the appropriate name
10+
if [ "$( docker container inspect -f '{{.State.Running}}' 'docker-container-name' )" = "true" ]
11+
then
12+
/usr/bin/python3 [path]]/transmission-trackers.py
13+
fi

transmission-trackers.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,5 +253,7 @@ def readLocalLists():
253253
if diff:
254254
lg('{}: Adding {} trackers (before: {})'.format(t.name, len(diff), len(ttrk)))
255255
tc.change_torrent(t.id, trackerAdd=list(diff))
256+
time.sleep(1)
257+
tc.reannounce_torrent(t.id)
256258
else:
257259
dbg('{}: update not needed'.format(t.name))

0 commit comments

Comments
 (0)