Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Add tracker filter
That way we can exclude e.g. private tracker torrents
  • Loading branch information
lpapadakos committed Mar 6, 2025
commit 65cc825ed32bf810be5960d66f481710d7a2ad72
9 changes: 9 additions & 0 deletions transmission-trackers.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@
# If empty - will affect all torrents
'status_filter': (),

# Ignore torrents that contain any of these trackers.
# This is useful, e.g., for excluding torrents from private trackers.
# trackers are matched by substring, so you can cover https://my.site/announce with just my.site
'tracker_filter': [],

# A list of URLs where to get the tracker lists from.
# The lists are combined into one with duplicates removed.
# The trackers from these lists are checked by looking up the URL's hostname in DNS.
Expand Down Expand Up @@ -248,6 +253,10 @@ def readLocalLists():
for trk in t.trackers:
ttrk.add(getattr(trk, 'fields', trk).get('announce'))

if any(tracker in url for url in ttrk for tracker in config['tracker_filter']):
dbg('{}: skipping due to tracker filter'.format(t.name))
continue

diff = trackers - ttrk

if diff:
Expand Down