You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

change-tracker.py 330B

1234567891011121314151617
  1. #! /usr/bin/env python
  2. import sys
  3. import bencode
  4. torrentIn = sys.argv[1]
  5. tracker = sys.argv[2]
  6. torrentOut = sys.argv[3]
  7. with open(torrentIn, 'rb') as f:
  8. bencoded = f.read()
  9. data = bencode.bdecode(bencoded)
  10. data['announce'] = tracker
  11. bencoded = bencode.bencode(data)
  12. with open(torrentOut, 'wb') as f:
  13. f.write(bencoded)