您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

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)