How to Check Torrent Integrity in aria2?
This article provides a straightforward guide on how to verify the local data integrity of a downloaded torrent using the aria2 command-line utility. You will learn the exact command-line options required to trigger a hash check, how to force a recheck on existing files, and how to automate this process for future downloads.
The Core Command for Torrent Verification
To verify the integrity of a locally downloaded torrent against its
original metadata, you use the --check-integrity option.
When this option is set to true, aria2 hashes the local
files and compares them with the piece hashes found in the
.torrent file.
The standard command structure is:
aria2c --check-integrity=true /path/to/file.torrent
How aria2 Handles Integrity Checks
- On-the-Fly Verification: By default, if you include
--check-integrity=truewhen starting a new download, aria2 will check any existing local data before resuming. If a piece is found to be corrupt or incomplete, aria2 automatically redownloads only that specific piece. - Post-Download Validation: If you have already finished downloading a torrent without this option enabled and want to ensure no corruption occurred during the final disk write, running the command with the integrity flag will scan the completed file structure.
Essential Related Options
To optimize or customize the verification process, you can pair the integrity check with these additional flags:
--seed-time=0: If you only want to verify the data and do not want to upload (seed) the torrent to the swarm after the check completes, append this flag to exit the program immediately after validation.-d /path/to/data: Use the-d(directory) flag if your downloaded files are stored in a different location than your current working directory or the directory where the.torrentfile resides.
Complete Command Example
To verify a completed torrent stored in a specific downloads folder and exit immediately without seeding, run:
aria2c --check-integrity=true -d /home/user/downloads /path/to/file.torrent --seed-time=0