Skip to main content

A Python CLI tool for creating torrent files

Project description

Torrent Creator Version 1.2.0

Torrent Creator is a Python-based CLI tool that allows users to easily create torrent files. It supports both single-file and multi-file torrents, customizable torrent piece sizes, and platform detection (Windows/Linux). This tool also generates magnet URIs based on user preferences and allows users to customize the tracker type for private or public trackers.

Features

  • Create Single-File or Multi-File Torrents: Supports creating torrents from individual files or entire directories.
  • Platform Detection: Automatically detects the operating system (Windows or Linux) and saves configuration (.env) in the appropriate location.
    • Windows: .env is saved in C:/torrent-creator/.env
    • Linux: .env is saved in /home/<username>/torrent-creator/.env
  • Customizable Piece Size: Allows selecting a piece size from 256 KB to 16 MB.
  • Magnet URL Generation: Optionally generates and displays a magnet URL after the torrent is created.
  • Override Configuration via CLI: Allows overriding the default .env values (such as output path, announce URL, piece size, etc.) directly from the command line.
  • Private or Public Tracker Types: Customizable tracker type with an option to enable/disable DHT, PeX, and LSD based on the tracker type.
  • Reconfigure .env File: Supports resetting and reconfiguring the .env file with the --reset-env option.

Installation

To install the tool, run the following command:

pip install torrent-creator

Alternatively, you can clone the repository and install it locally:

git clone https://github.com/yourusername/torrent-creator.git
cd torrent-creator
python torrent-creator.py

Setup / Configuration

Upon the first run, torrent-creator will prompt you to configure the following settings:

  • TORRENT_OUTPUT_PATH: Path where the .torrent files will be saved.

  • ANNOUNCE_URL: The announce URL for the torrent tracker.

  • PRINT_MAGNET_URL: Whether to print the magnet URI after creation (true or false).

  • PLATFORM: The platform (1 for Windows, 2 for Linux).

  • PIECE_SIZE: The size of each piece in bytes (must be one of the predefined sizes).

  • TRACKER_TYPE: The type of tracker (1 for public, 2 for private).

Usage

                           [--platform PLATFORM] [--magnet] [--reset-env]
                           [-set] [-t] [-l] [--tracker-type {1,2}]
                           [-current-conf] [filename]


positional arguments:
  <filename>/directory              The file or directory to create a torrent from.

optional arguments:
  -h, --help            Show this help message and exit.
  -p                    Show current path for .torrent file output.
  -a ANNOUNCE, --announce ANNOUNCE
                        Override announce URL.
  -o OUTPUT, --output OUTPUT
                        Override output directory.
  --ps PS, --piece-size PS
                        Override piece size (bytes).
  --platform PLATFORM   Override platform (1=Windows, 2=Linux).
  --magnet              Print magnet URI after creation.
  --reset-env           Reconfigure the .env file.
  -set                  Set environment variables interactively.
  -t, --trackers        Show trackers from an existing torrent file.
  -l, --list            List files in the torrent directory.
  --tracker-type {1,2}  Set tracker type: 1=Public, 2=Private.

Last Changes

Torrent-Creator Version 1.2.0

  • Added progress bar for real-time file and piece processing
  • Improved CLI interface with detailed help and usage examples
  • Added better error handling and argument validation
  • Replaced .env management for platform-specific configurations (Windows/Linux)
  • Introduced new option to interactively configure environment variables
  • Support for multiple tracker URLs in torrent creation
  • Enhanced logging functionality for better debugging and user feedback
  • Added functionality to show current configuration via -current-conf
  • Ability to override torrent piece size and output directory via command line
  • Fixed env conflict
  • other bugs fixed

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

torrent_creator-1.2.0.tar.gz (10.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

torrent_creator-1.2.0-py3-none-any.whl (12.5 kB view details)

Uploaded Python 3

File details

Details for the file torrent_creator-1.2.0.tar.gz.

File metadata

  • Download URL: torrent_creator-1.2.0.tar.gz
  • Upload date:
  • Size: 10.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.13

File hashes

Hashes for torrent_creator-1.2.0.tar.gz
Algorithm Hash digest
SHA256 2f40dc7be2df99872359fb5c776775909a76b66c19126d6c4ebc25b47131edfe
MD5 56ae0bce14c72db33c4c35f8f1b30c46
BLAKE2b-256 363fcda0a3a3334dbc45c43e68d6750a6f1f3c40253d9274be8d48444b6852c3

See more details on using hashes here.

File details

Details for the file torrent_creator-1.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for torrent_creator-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 967de645ee2c47c73367258460303ac8cdc7a656c4083f3595344fc7b04b2742
MD5 5fb512a999b23be82767e6351a2f2e80
BLAKE2b-256 881d0e692ec1f7534e860ebb16b62ca46eca829e9739293da997d112d34ee729

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page