Skip to content

taggedzi/netset2p2p

netset2p2p

CI Python Ruff Coverage Version SBOM License: MIT

πŸ”„ netset β†’ p2p Converter

netset2p2p is a lightweight Python library and CLI tool that converts .netset IP blocklists into .p2p (PeerGuardian-compatible) format.


🎯 Why This Exists

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.


✨ Features

  • 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
  • Strips comments (# ...) and invalid lines
  • CLI + Python library interface
  • Clean src/ layout
  • CI, linting, type-checking, and tests included

πŸ“¦ Installation

Local install

python -m pip install -e .

Install with development tools

python -m pip install -e .[dev]

πŸš€ Usage

CLI

netset2p2p input.netset -o output.p2p

Optional: specify a custom label for generated entries:

netset2p2p input.netset -o output.p2p --label firehol_level1

Python Library

from 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

πŸ”§ Example Workflow

  1. Download a .netset blocklist (e.g. FireHOL)

  2. Convert it:

    netset2p2p firehol_level1.netset -o firehol_level1.p2p
  3. Import the .p2p file into your torrent client (e.g. qBittorrent)


πŸ§ͺ Development

Run checks locally:

ruff check .
mypy src
pytest

πŸ“¦ Release Process

Prerequisites

  • gh authenticated for this repository
  • Clean git working tree
  • Release notes added under ## [Unreleased] in CHANGELOG.md

Create a release

python scripts/release.py --bump patch

This will:

  • Update version in pyproject.toml
  • Promote changelog entries into a release section
  • Run linting, typing, and tests
  • Build sdist and wheel
  • Generate checksums, SBOM (CycloneDX), and provenance
  • Tag and push
  • Create a GitHub release with artifacts

⚠️ Disclaimer

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.


πŸ” Security Note

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.


πŸ€– AI Tooling Notice

This project was created with the assistance of AI tooling.


πŸ“œ License

MIT. See LICENSE.

About

Convert FireHOL and other .netset IP blocklists into PeerGuardian-compatible .p2p format for use with torrent clients like qBittorrent.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Contributors

Languages