Browse Source

change torrent tracker tool

master
Robin Thoni 9 years ago
parent
commit
124904d3b7
1 changed files with 17 additions and 0 deletions
  1. 17
    0
      change-tracker.py

+ 17
- 0
change-tracker.py View File

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

Loading…
Cancel
Save