Skip to content

Commit

Permalink
过滤 i2p 和 tor 匿名网络用户
Browse files Browse the repository at this point in the history
  • Loading branch information
Ghost-chu committed Sep 6, 2024
1 parent 163e7f9 commit cdee70c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -423,8 +423,8 @@ private DownloadRecord getDownloadRecord(Download download) {
private PeerManagerRecord getPeerManagerRecord(PeerManager peerManager) {
if (peerManager == null) return null;
return new PeerManagerRecord(
Arrays.stream(peerManager.getPeers()).map(this::getPeerRecord).collect(Collectors.toList()),
Arrays.stream(peerManager.getPendingPeers()).map(this::getDescriptorRecord).collect(Collectors.toList()),
Arrays.stream(peerManager.getPeers()).map(this::getPeerRecord).filter(Objects::nonNull).collect(Collectors.toList()),
Arrays.stream(peerManager.getPendingPeers()).map(this::getDescriptorRecord).filter(Objects::nonNull).collect(Collectors.toList()),
getPeerManagerStatsRecord(peerManager.getStats()),
peerManager.isSeeding(),
peerManager.isSuperSeeding()
Expand Down Expand Up @@ -464,6 +464,7 @@ private PeerRecord getPeerRecord(Peer peer) {
if (peer instanceof PeerImpl) {
client = ((PeerImpl) peer).getDelegate().getClientNameFromExtensionHandshake();
}
if(peer.getIp().endsWith(".i2p") || peer.getIp().endsWith(".onion")|| peer.getIp().endsWith(".tor")) return null;
return new PeerRecord(
peer.isMyPeer(),
peer.getState(),
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/plugin.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ plugin.class=com.ghostchu.peerbanhelper.downloaderplug.biglybt.Plugin
plugin.name=PeerBanHelper-Adapter
plugin.langfile=com.ghostchu.peerbanhelper.downloaderplug.biglybt.Messages
plugin.id=peerbanhelperadatper
plugin.version=1.2.3
plugin.version=1.2.4

0 comments on commit cdee70c

Please sign in to comment.