Skip to content
Alex edited this page Apr 2, 2022 · 5 revisions

Welcome to the torrentfile wiki!

torrentfile is a command line utility for creating Bittorrent meta files, and many other features regarding torrent files.

Features

  • Create torrent files using any version (including hybrids)
  • Display detailed information about a pre-existing torrent file
  • Edit details of a torrent file
  • Check torrent file/folder contents against a torrent file for percent completed and integrity.
  • Create Magnet URI from torrent file.

Installation

There are multiple ways to download/install torrentfile.

Using pip:

pip install torrentfile

Using git:

git clone https://github.com/alexpdev/torrentfile.git
cd torrentfile
python3 setup.py install

Torrentfile Usage Details


Option Details

If you input torrentfile in a terminal after installing will show you the available subcommands.

-h: Does the same as torrentfile

Not all subcommands have the same options so entering any of them with -h will show their available options.

torrentfile create options

The only required argument to the create subcommand is the path to the torrent content.

Example: torrentfile create /path/to/content

The rest are all optional:

-a, -t, --announce, and --tracker all do behave the same. They add trackers to the newly created torrent files tracker list. The option can be used more than once if needed or urls can be listed in a row seperated by a single space. Example -t http://url1 http://url2 .... There is not limit to the amount of trackers that can be added.

-w and --web-seeds similarly adds urls to the list of web-seeds for the torrent and behaves the same as the options for the tracker list.

--comment should be followed by text in quotations in order to leave a comment inside the meta file. Example: --comment "Created for MyTrackerExample.com"

--source is used for adding a source string. They are typically one word so quotes are usually not needed, however if the source string has a space it will need to be quoted. Example: --source MyTrackerExample

-p or --private should be used if you are creating the torrent for a private tracker. When this option is enabled DHT and multi-tracker protocol are disabled.

--piece-length enables custom piece-length choice for the torrent. This option can be picky because the number either must be a perfect power of two (e.g. 32768 or 524288) or the easier approach is to input the integer exponent between 14-29. Example: --piece-length 14 or --piece-length 16384. The even easier option is to ignore this option and let torrentfile choose for you.

--meta-version is how you select which version of the Bittorrent Protocol the torrent file is intended for. Most clients are still using version 1, so that remains the default for now. The alternatives are version 2, and version1 version2 hybrids. Examples: --meta-version 1 explicitly chooses version 1, and its also the default --meta-version 2 explicitly chooses version 2 --meta-version 3 creates a version 1 & version 2 hybrid.

-o and --out can be used to specify where the torrent should be saved. Currently the default is to save it adjacent to the torrent content. Using this option means you must supply the full path filename and all. Example: torrent content path is at /home/user/torrents/content the default would create /home/user/torrents/content.torrent

--cwd or --current simply changes the default save location to the current working directory. Example: torrent content at /home/user/torrents/content this option would save to ./content.torrent

--noprogress option suppresses the progress bar that is shown by default to identify the amount of time is needed.

I think that's it for the create command.....

Precompiled binaries for linux and windows can also be found on the releases page.

If the latest binaries cannot be found, please open an Issue

Documentation

Full documentation for the app including usage examples, the full API and other implementation details can be found on github pages

Clone this wiki locally