| Crates.io | torrent-combine |
| lib.rs | torrent-combine |
| version | 0.1.1 |
| created_at | 2025-07-17 12:24:19.834313+00 |
| updated_at | 2025-08-07 07:13:39.932946+00 |
| description | A tool to merge partially completed torrent data downloads. |
| homepage | |
| repository | https://github.com/mason-larobina/torrent-combine |
| max_upload_size | |
| id | 1757401 |
| size | 47,345 |
A Rust CLI tool to merge partially downloaded torrent files (e.g., videos) within a directory tree. It groups files by name and size, performs sanity checks for compatibility, and merges them using bitwise OR on their contents. Merged files are saved with a .merged suffix or can replace originals with the --replace flag.
This tool scans a root directory recursively for files larger than 1MB (targeting video files). It assumes partial torrent downloads are pre-allocated with zeros and merges compatible files:
.merged files for incomplete originals (unless --replace is used to overwrite them).For details, see DESIGN.md.
Both require Rust and Cargo (install via rustup).
cargo install torrent-combine
git clone https://github.com/mason-larobina/torrent-combine
cd torrent-combine
cargo install --path=.
Run the tool with a root directory path:
torrent-combine /path/to/torrent/root/dir
--replace: Replace incomplete original files with merged content instead of creating .merged files.Assume two partial files /downloads/torrent-a/video.mkv (size 10MB, partial) and /downloads/torrent-b/video.mkv (size 10MB, more complete):
torrent-combine /downloads
This creates /downloads/torrent-a/video.mkv.merged if the torrent-a/video.mkv was able to fill in missing chunks from torrent-b/video.mkv.
Likewise the /downloads/torrent-b/video.mkv.merged file is created if the torrent-b/video.mkv file was able to fill in missing chunks from torrent-a/video.mkv.
To merge the files in-place use the replace flag:
torrent-combine /downloads --replace
This overwrites the incomplete /downloads/torrent-a/video.mkv and or /downloads/torrent-b/video.mkv with the merged content if applicable.
Fork the repo, make changes, and submit a pull request. See CONVENTIONS.md for coding standards.
MIT License.