From 5bee0b32f0db21741f278a1c8c10cd7396515ffd Mon Sep 17 00:00:00 2001 From: ap-pauloafonso Date: Mon, 27 Apr 2020 23:40:54 -0300 Subject: [PATCH] single-file fix --- README.md | 4 ++-- ratio-spoof.py | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index afe61d6..246ab62 100644 --- a/README.md +++ b/README.md @@ -12,9 +12,8 @@ Ratio-spoof acts like a normal bittorrent client but without downloading or uplo ## Usage With a recent python3 version installed, you will be able to run it on linux/macos/windows. ``` -usage: ratio-spoof.py [-h] -t -d -u +usage: ratio-spoof.py -t -d -u -ratio-spoof is a open source tool to trick private trackers optional arguments: -h, --help show this help message and exit @@ -50,5 +49,6 @@ The currently emulation is hard coded to be a popular and accepted client qbitto ## Resources http://www.bittorrent.org/beps/bep_0003.html + https://wiki.theory.org/index.php/BitTorrentSpecification diff --git a/ratio-spoof.py b/ratio-spoof.py index a7415a1..3c6041b 100755 --- a/ratio-spoof.py +++ b/ratio-spoof.py @@ -145,6 +145,9 @@ def clear_screen(): print("\033c", end="") def t_total_size(data): + if ('length' in data['info']): + return data['info']['length'] + return sum(map(lambda x : x['length'] , data['info']['files'])) def t_infohash_urlencoded(data, raw_data):