Skip to content

Instantly share code, notes, and snippets.

@drx
Created January 23, 2016 15:22
Show Gist options
  • Save drx/ab14961f0c1d37bcf5c9 to your computer and use it in GitHub Desktop.
Save drx/ab14961f0c1d37bcf5c9 to your computer and use it in GitHub Desktop.
Add 'bibliotik.me' tracker to bibliotik torrents in Transmission Daemon
from transmission import Transmission
# configure these two lines
new_tracker = 'https://bibliotik.me/announce.php?passkey=XXX' # insert your own passkey
client = Transmission(host='localhost', port=9091, username='user', password='password') # change to your details
response = client('torrent-get', ids=range(1,10000), fields=['id', 'name', 'hashString', 'trackers'])
bib_ids = []
for torrent in response['torrents']:
bib_org = False
bib_me = False
bib_org_id = None
for tracker in torrent['trackers']:
if 'bibliotik.org' in tracker['announce'].lower():
print torrent['id'], torrent['name']
print tracker
print
bib_org = True
if 'bibliotik.me' in tracker['announce'].lower():
bib_me = True
if bib_org and not bib_me:
bib_ids.append(torrent['id'])
client('torrent-set', ids=bib_ids, trackerAdd=[new_tracker])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment