Page 1 of 1
qBittorrent PR to display I2P peers in WebUI
Posted: Tue Aug 05, 2025 6:19 pm
by anikey
I've made a pull request to qBittorrent that enables display of I2P peers in the WebUI peer list. Previously, it only displayed I2P peers on the GUI version.
Check it out here:
https://github.com/qbittorrent/qBittorrent/pull/23061
You may apply the patch (append ".diff" or ".patch" to the URL to download it) and compile qBT yourself (it's not that hard), to get this feature before it gets into a qBT release.
(This is only relevant to those who use the "-nox" version of qBittorrent, i.e. run it without a GUI and instead access it through a web browser)
Re: qBittorrent PR to display I2P peers in WebUI
Posted: Thu Aug 07, 2025 12:49 pm
by cumlord
nice work

Re: qBittorrent PR to display I2P peers in WebUI
Posted: Sat Aug 09, 2025 1:11 pm
by anikey
Just in case, posting the patch here:
Code: Select all
diff --git a/src/webui/api/synccontroller.cpp b/src/webui/api/synccontroller.cpp
index b324fd541b61..c862ca0b9a1a 100644
--- a/src/webui/api/synccontroller.cpp
+++ b/src/webui/api/synccontroller.cpp
@@ -847,12 +847,15 @@ void SyncController::torrentPeersAction()
for (const BitTorrent::PeerInfo &pi : peersList)
{
- if (pi.address().ip.isNull()) continue;
+ const bool useI2PSocket = pi.useI2PSocket();
+ if (pi.address().ip.isNull() && !useI2PSocket) continue;
+
+ const QString address = useI2PSocket ? pi.I2PAddress() : pi.address().ip.toString();
QVariantMap peer =
{
- {KEY_PEER_IP, pi.address().ip.toString()},
- {KEY_PEER_PORT, pi.address().port},
+ {KEY_PEER_IP, address},
+ {KEY_PEER_PORT, useI2PSocket ? 0 : pi.address().port},
{KEY_PEER_CLIENT, pi.client()},
{KEY_PEER_ID_CLIENT, pi.peerIdClient()},
{KEY_PEER_PROGRESS, pi.progress()},
@@ -876,13 +879,13 @@ void SyncController::torrentPeersAction()
peer.insert(KEY_PEER_FILES, filesForPiece.join(u'\n'));
}
- if (resolvePeerCountries)
+ if (resolvePeerCountries && !useI2PSocket)
{
peer[KEY_PEER_COUNTRY_CODE] = pi.country().toLower();
peer[KEY_PEER_COUNTRY] = Net::GeoIPManager::CountryName(pi.country());
}
- peers[pi.address().toString()] = peer;
+ peers[address] = peer;
}
data[u"peers"_s] = peers;
Re: qBittorrent PR to display I2P peers in WebUI
Posted: Sat Sep 06, 2025 6:08 pm
by anikey
The fix has been changed and split up into two PRs, but in the end they got merged.
This functionality will most likely land in qBT 5.2.