summaryrefslogtreecommitdiffstats
path: root/bittorrent-tracker.py
diff options
context:
space:
mode:
Diffstat (limited to 'bittorrent-tracker.py')
-rwxr-xr-xbittorrent-tracker.py26
1 files changed, 18 insertions, 8 deletions
diff --git a/bittorrent-tracker.py b/bittorrent-tracker.py
index 52dace4..4c176da 100755
--- a/bittorrent-tracker.py
+++ b/bittorrent-tracker.py
@@ -12,13 +12,23 @@
# Written by Bram Cohen
-if __name__ == '__main__':
- from BitTorrent.platform import install_translation
- install_translation()
+from BitTorrent.platform import install_translation
+install_translation()
-import os
-from sys import argv
-from BitTorrent.track import track
+from BitTorrent.track import Tracker, InfoPage, Scrape, File, Announce, FavIcon
-if __name__ == '__main__':
- track(argv[1:])
+from twisted.application import internet, service
+from twisted.web import static, server
+
+tracker = Tracker()
+root = InfoPage(tracker)
+root.putChild('scrape', Scrape(tracker))
+root.putChild('file', File(tracker))
+root.putChild('announce', Announce(tracker))
+root.putChild('favicon.ico', FavIcon(tracker))
+
+application = service.Application('NoGooee BitTorrent Tracker')
+site = server.Site(root)
+sc = service.IServiceCollection(application)
+i = internet.TCPServer(8080, site)
+i.setServiceParent(sc)