Skip to content

Commit e5c6e3f

Browse files
committed
fix error save ip set and add try except for add tracker
1 parent a4ad0ac commit e5c6e3f

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

transmission-trackers.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,7 @@ def validateTrackerURL(url, dns=True):
140140
if ip in ips:
141141
dbg("Host's '{}' IP '{}' is duplicate".format(h, ip))
142142
return False
143-
144-
ips.add(ip)
143+
ips.add(ip)
145144

146145
dbg("Approving tracker '{}'".format(url))
147146
hosts.add(h)
@@ -248,6 +247,10 @@ def readLocalLists():
248247

249248
if diff:
250249
lg('{}: Adding {} trackers (before: {})'.format(t.name, len(diff), len(ttrk)))
251-
tc.change_torrent(t.id, trackerAdd=list(diff))
250+
try:
251+
tc.change_torrent(t.id, trackerAdd=list(diff))
252+
except Exception as e:
253+
dbg('{}: Adding trackers failed,error: {})'.format(t.name, e))
254+
continue
252255
else:
253256
dbg('{}: update not needed'.format(t.name))

0 commit comments

Comments
 (0)