Skip to content

Commit 65cc825

Browse files
committed
Add tracker filter
That way we can exclude e.g. private tracker torrents
1 parent f6a7586 commit 65cc825

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

transmission-trackers.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@
2121
# If empty - will affect all torrents
2222
'status_filter': (),
2323

24+
# Ignore torrents that contain any of these trackers.
25+
# This is useful, e.g., for excluding torrents from private trackers.
26+
# trackers are matched by substring, so you can cover https://my.site/announce with just my.site
27+
'tracker_filter': [],
28+
2429
# A list of URLs where to get the tracker lists from.
2530
# The lists are combined into one with duplicates removed.
2631
# The trackers from these lists are checked by looking up the URL's hostname in DNS.
@@ -248,6 +253,10 @@ def readLocalLists():
248253
for trk in t.trackers:
249254
ttrk.add(getattr(trk, 'fields', trk).get('announce'))
250255

256+
if any(tracker in url for url in ttrk for tracker in config['tracker_filter']):
257+
dbg('{}: skipping due to tracker filter'.format(t.name))
258+
continue
259+
251260
diff = trackers - ttrk
252261

253262
if diff:

0 commit comments

Comments
 (0)