netset2p2p is a lightweight Python library and CLI tool that converts .netset IP blocklists into .p2p (PeerGuardian-compatible) format.
Many modern blocklists (such as those from FireHOL) are distributed in .netset format, while torrent clients like qBittorrent still expect legacy .p2p blocklists.
This tool bridges that gap:
Convert modern blocklists β into formats your torrent client actually understands.
- Convert
.netsetβ.p2p(PeerGuardian format) - Supports:
- CIDR ranges (
1.2.3.0/24) - Explicit ranges (
1.2.3.0-1.2.3.255) - Single IPs
- CIDR ranges (
- Strips comments (
# ...) and invalid lines - CLI + Python library interface
- Clean
src/layout - CI, linting, type-checking, and tests included
python -m pip install -e .python -m pip install -e .[dev]netset2p2p input.netset -o output.p2pOptional: specify a custom label for generated entries:
netset2p2p input.netset -o output.p2p --label firehol_level1from netset2p2p import convert_netset_text_to_p2p
result = convert_netset_text_to_p2p(
"# firehol\n10.0.0.0/30\n198.51.100.7\n",
label="firehol",
)
print(result)Output:
firehol:10.0.0.0-10.0.0.3
firehol:198.51.100.7-198.51.100.7
-
Download a
.netsetblocklist (e.g. FireHOL) -
Convert it:
netset2p2p firehol_level1.netset -o firehol_level1.p2p
-
Import the
.p2pfile into your torrent client (e.g. qBittorrent)
Run checks locally:
ruff check .
mypy src
pytestghauthenticated for this repository- Clean git working tree
- Release notes added under
## [Unreleased]inCHANGELOG.md
python scripts/release.py --bump patchThis will:
- Update version in
pyproject.toml - Promote changelog entries into a release section
- Run linting, typing, and tests
- Build
sdistand wheel - Generate checksums, SBOM (CycloneDX), and provenance
- Tag and push
- Create a GitHub release with artifacts
This project is an independent tool and is not affiliated with, endorsed by, or supported by:
- FireHOL
- qBittorrent
- PeerGuardian
- Any related projects or organizations
Any references to these tools or formats are for compatibility and demonstration purposes only.
IP blocklists provide limited protection and should not be relied upon as a primary security or privacy mechanism.
They are best used as a supplemental layer alongside proper network, privacy, and verification practices.
This project was created with the assistance of AI tooling.
MIT. See LICENSE.