Skip to content

A command-line tool for creating torrent files. Support for torrent versions: V1, V2, and Hybrid.

License

Notifications You must be signed in to change notification settings

cantalupo555/torrent-builder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Torrent Builder

The Torrent Builder is a command-line tool for creating torrent files, offering a complete and customizable experience. With support for interactive and non-interactive modes, you can create torrents quickly and efficiently, either through a step-by-step wizard or with direct commands. The tool allows you to configure various aspects of the torrent, such as version (V1, V2, or Hybrid), comments, privacy, web seeds, and trackers, ensuring your torrents are created exactly as you need them.

Features

  • Create torrent files from single files or directories
  • Support for torrent versions: V1, V2, and Hybrid
  • Interactive mode with step-by-step configuration
  • Command-line interface with options for all features
  • Automatic piece size calculation based on file size
  • Manual piece size configuration
  • Support for private torrents
  • Add multiple trackers and web seeds
  • Include comments in torrent metadata
  • Detailed summary output after creation

Prerequisites

Before building, ensure you have the following installed:

Linux

  • Build Tools: build-essential
  • CMake: cmake (>= 3.28.3)
  • libtorrent: libtorrent-rasterbar-dev (>= 2.0.11)

Install them using:

sudo apt-get install build-essential cmake libtorrent-rasterbar-dev

macOS

  • CMake: cmake (>= 3.28.3)
  • libtorrent: libtorrent-rasterbar (>= 2.0.11)

Install them using:

brew install cmake libtorrent-rasterbar

Installation

To build the project, you will need a C++20 compatible compiler.

Build Instructions

mkdir build
cd build
cmake ..
cmake --build .

Usage

Interactive Mode

./torrent_builder -i

Command-line Mode

./torrent_builder --path /path/to/file_or_directory --output output.torrent [options]

Options

  -h, --help                 Show help
  -i, --interactive          Run in interactive mode
  --path arg                 Path to file or directory (required)
  --output arg               Output torrent file path (required)
  --version arg              Torrent version (1=v1, 2=v2, 3=hybrid) (default: 3)
  --comment arg              Torrent comment
  --private                  Make torrent private
  --default-trackers         Use default trackers
  --tracker arg              Add tracker URL (can be used multiple times)
  --webseed arg              Add web seed URL (can be used multiple times)
  --piece-size arg           Piece size in KB (must be one of: 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768)
  --creator                  Set "Torrent Builder" as creator
  --creation-date            Set creation date

Examples

  ./torrent_builder -i
  ./torrent_builder --path /data/file --output file.torrent
  ./torrent_builder --path /data/file --output file.torrent --default-trackers
  ./torrent_builder --path /data/folder --output folder.torrent --version 2 --private
  ./torrent_builder --path /data/file --output file.torrent --piece-size 1024

Add multiple trackers

Trackers are added in ascending order of priority. The first tracker has the highest priority (tier 0).

./torrent_builder --path /data/file --output file.torrent \
  --tracker udp://tracker.example.com:80 \
  --tracker http://backup-tracker.org:6969

Add multiple web seeds

./torrent_builder --path /data/file --output file.torrent \
  --webseed http://example.com/file \
  --webseed http://mirror.com/file

Create torrent with comment

./torrent_builder --path /data/file --output file.torrent \
  --comment "My important file"

Create a torrent with default trackers and custom trackers

./torrent_builder --path /data/file --output file.torrent --default-trackers --tracker udp://mytracker.com:8080

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

A command-line tool for creating torrent files. Support for torrent versions: V1, V2, and Hybrid.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published