Some Russian trackers add a tracker to their torrents called "retracker.local". So that your network admin can setup a local tracker which enables people behind the same private network to peer with each other. This is all well and good, except for most people this address doesn't exists causing the torrent to give an error. It doesn't affect the performance of the torrent but it will always show as having an error, which makes it difficult to spot torrents with actual errors. So I made a quick script to disable that tracker when adding new torrents, that I wanted to share in case anyone else ran into the same issue.
Code:
system.method.set_key = event.download.inserted_new,disable_retracker,"execute={~/disable_retracker.py,$d.get_hash=}".rtorrent.rc
Code:
#!/usr/bin/env python
import xmlrpclib, os, sys
rid = sys.argv[1]
rtorrent = xmlrpclib.ServerProxy('http://localhost/rutorrent/RPC2')
trackers = rtorrent.t.multicall(rid, '', 't.is_enabled=', 't.get_url=')
for i,tracker in enumerate(trackers):
if tracker[0] and tracker[1] == 'http://retracker.local/announce':
rtorrent.t.set_enabled(rid, i, 0)
print 'Found enabled retracker, disabling'
disable_rtorrent.py
Code:
system.method.set_key = event.download.inserted_new,disable_retracker,"execute={~/disable_retracker.py,$d.get_hash=}".rtorrent.rc
Code:
#!/usr/bin/env python
import xmlrpclib, os, sys
rid = sys.argv[1]
rtorrent = xmlrpclib.ServerProxy('http://localhost/rutorrent/RPC2')
trackers = rtorrent.t.multicall(rid, '', 't.is_enabled=', 't.get_url=')
for i,tracker in enumerate(trackers):
if tracker[0] and tracker[1] == 'http://retracker.local/announce':
rtorrent.t.set_enabled(rid, i, 0)
print 'Found enabled retracker, disabling'
disable_rtorrent.py