Important
Although I haven't updated anything here the last months, this whole project still works.
- Features
- Prerequisites
- Configuration
- Usage
- Downloads
- Building from source
- Different qBittorrent versions
- License
- Credits
- Ban Peers by their client name
- Ban Peers by their country code
- (optional) VPN detection to prevent false positives
- Authentication support
- Nice and easy configuration menu
- persistent settings
- Python 3.x
requests
library in Python (install viapip install requests
)colorama
library in Python (install viapip install colorama
)qbittorrent-api
library in Python (install viapip install qbittorrent-api
)hue_shift
library in Python (install viapip install hue_shift
)- qBitTorrent with the Web UI enabled
The script will ask you for everything and explain everything.
If you still have questions, feel free to use the discussion tab.
- Ensure qBitTorrent's Web UI is enabled and configured.
- Run the script:
python path/to/main.py
- The script will check all peers every 5 seconds and ban those matching the blacklist / country codes.
The script is also available in binary for x64 Linux / Windows and can be downloaded in the releases
- Windows
- Linux
- Python3
- git
Windows:
Invoke-Expression (Invoke-WebRequest -Uri "https://raw.githubusercontent.com/EchterAlsFake/qbittorrent_peer_ban/master/build_windows.ps1" -UseBasicParsing).Content
Linux: curl -sL "https://raw.githubusercontent.com/EchterAlsFake/qbittorrent_peer_ban/master/build_linux.sh" | bash
Only for Legacy usage! The v2 supports both versions.
- The script is set up for qBitTorrent 4.5.x and later versions. If you are using qBitTorrent version 4.4.x, you need to modify the
ban_peer
function in the script.- Uncomment the line for 4.4.x and comment out the line for 4.5.x in the
ban_peer
function.
- Uncomment the line for 4.4.x and comment out the line for 4.5.x in the
- Ensure that 'bypass authentication for clients on localhost' is enabled in qBitTorrent's Web UI settings if you don't want to set up authentication for the API.
This script is licensed under GPLv3. See: https://www.gnu.org/licenses/gpl-3.0.en.html
Original concept by: https://recolic.net/blog/post/qbittorrent-ban-xunlei
Adapted and expanded by: Johannes Habel
Additional help by ChatGPT