diff --git a/transmission-trackers.py b/transmission-trackers.py index 01a9d30..3a5e8c6 100755 --- a/transmission-trackers.py +++ b/transmission-trackers.py @@ -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. @@ -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: