Browse Source

main

master
Robin Thoni 9 years ago
parent
commit
78be8bec83
1 changed files with 17 additions and 4 deletions
  1. 17
    4
      fake-tracker.py

+ 17
- 4
fake-tracker.py View File

@@ -1,11 +1,24 @@
1 1
 #! /usr/bin/env python
2 2
 
3
+import sys
3 4
 import torrentfile
4
-import torrententry
5
+import torrenttracker
6
+import config
7
+
8
+if len(sys.argv) >= 2:
9
+    config = config.Config(sys.argv[1])
10
+else:
11
+    config = config.Config()
12
+
13
+maxRatio = config.getMaxRatio()
14
+maxRate = config.getMaxRatio()
15
+
16
+
5 17
 
6 18
 for file in ('torrent.torrent', 'torrent2.torrent'):
7 19
     torrent = torrentfile.TorrentFile()
8 20
     torrent.readFile(file)
9
-    print torrent.getSize()
10
-    print torrent.getTracker()
11
-    print torrent.getHash()
21
+    tracker = torrenttracker.TorrentTracker(torrent)
22
+    r = tracker.start()
23
+    print r
24
+    print tracker.getInterval()

Loading…
Cancel
Save