Skip to content

InterfaceX-co-jp/make-torrent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

make-torrent

A Node.js utility for creating and parsing torrent files.

Features

  • Create Torrent Files: Generate .torrent files from any file
  • Generate Magnet Links: Automatically create magnet URIs for torrents
  • Parse Torrent Files: Read and extract information from existing .torrent files
  • Outputs to organized directories (out/torrent, out/magnet, out/json, out/txt)

Installation

npm install

Usage

Create a Torrent File and Magnet Link

Use exec.js to create a .torrent file and magnet link from any file:

node src/exec.js --file <path-to-file> --name <torrent-name>

Example:

node src/exec.js --file package.json --name my-package

Output:

  • .torrent file saved to out/torrent/<torrent-name>.torrent
  • 🧲 Magnet link saved to out/magnet/<torrent-name>.txt
  • 📺 Magnet link displayed in console for easy copying

Example Output:

✅ Torrent created successfully!
📁 Torrent file: out/torrent/my-package.torrent
🧲 Magnet link: magnet:?xt=urn:btih:...&dn=my-package&tr=udp://tracker.opentrackr.org:1337/announce&tr=...
💾 Magnet saved to: out/magnet/my-package.txt

Trackers used:

  • udp://tracker.opentrackr.org:1337/announce
  • udp://open.tracker.cl:1337/announce
  • udp://open.demonii.com:1337/announce
  • udp://open.stealth.si:80/announce
  • udp://tracker.torrent.eu.org:451/announce
  • udp://exodus.desync.com:6969/announce
  • udp://tracker.tiny-vps.com:6969/announce

Parse a Torrent File

Use read.js to read and parse an existing .torrent file:

node src/read.js --torrent <path-to-torrent-file>

Example:

node src/read.js --torrent out/torrent/package.torrent

This will:

  • Output torrent metadata as JSON to out/json/<torrent-name>.json
  • Output piece hashes to out/txt/<torrent-name>
  • Display torrent information in the console

Output Structure

out/
├── torrent/    # Generated .torrent files
├── magnet/     # Magnet links (text files)
├── json/       # Parsed torrent metadata (JSON)
└── txt/        # Piece hashes (text)

Dependencies

License

ISC

About

Create .torrent made easy. Node.js script

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors