From 7634a231d6d81f7d4bdabd98aab4eb4ccacd5829 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Fontaine?= Date: Fri, 19 Apr 2019 12:22:07 +0200 Subject: [PATCH] send the request ith left=0, to appear as a seeder and not as a leecher --- code/process_torrent.py | 2 -- code/torrentclientfactory.py | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/code/process_torrent.py b/code/process_torrent.py index ce26550..055cfec 100644 --- a/code/process_torrent.py +++ b/code/process_torrent.py @@ -59,7 +59,6 @@ class process_torrent(): headers = tc.get_headers() params = tc.get_query(uploaded=0, downloaded=0, - left=self.info['length'], event='started') print('----------- First Command to Tracker --------') @@ -113,7 +112,6 @@ class process_torrent(): headers = tc.get_headers() params = tc.get_query(uploaded=uploaded, downloaded=downloaded, - left=0, event='stopped') content = self.send_request(params, headers) self.tracker_response_parser(content) diff --git a/code/torrentclientfactory.py b/code/torrentclientfactory.py index a4d27ee..a109c26 100644 --- a/code/torrentclientfactory.py +++ b/code/torrentclientfactory.py @@ -28,7 +28,7 @@ class Transmission292(): headers['Accept-Encoding'] = 'Accept-Encoding: gzip;q=1.0, deflate, identity' return headers - def get_query(self, uploaded, downloaded, left, event=None): + def get_query(self, uploaded, downloaded, left=0, event=None): # The total amount uploaded (since the client sent the 'started' event) self.parameters["uploaded"] = uploaded # The total amount downloaded (since the client sent the 'started' event)