MCPcopy Index your code
hub / github.com/Wintermute0110/torrentverify

github.com/Wintermute0110/torrentverify @v0.1.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.1.1 ↗ · + Follow
26 symbols 68 edges 1 files 9 documented · 35%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

torrentverify

A small utility written in Python that lists contents of torrent files, deletes unneeded files in the torrent downloaded data directory, and checks the torrent downloaded files for errors (either a fast test for file existence and size or a slower, comprehensive test using the SHA1 hash) optionally deleting or truncating wrong size files.

Usage and examples

To list the contents of a torrent file.

$ ./torrentverify.py -t my_file.torrent

To check if your downloaded files exist and have correct size.

$ ./torrentverify.py -t my_file.torrent -d /download_dir/ --check

where /download_dir/ is the directory where your Torrent client downloads the Torrent data. Notice that the actual data directory is /download_dir/ plus an internal directory inside the Torrent file. To ignore the Torrent file internal directory use.

$ ./torrentverify.py -t my_file.torrent -d /download_dir/ --check --odt

If you found files with size bigger than it should be in the data directory you may attempt to truncate those files to the correct size. In most cases, this solves most problems with the downloaded data.

$ ./torrentverify.py -t my_file.torrent -d /download_dir/ --check --truncateWrongSizeFiles

Alternatively, you can delete files having wrong size and then tell your Torrent client to check and download the missing parts again.

$ ./torrentverify.py -t my_file.torrent -d /download_dir/ --check --deleteWrongSizeFiles

You can also check if there are unneeded files in the torrent data directory.

$ ./torrentverify.py -t my_file.torrent -d /download_dir/ --checkUnneeded

If unneeded files are found you may wish to delete them.

$ ./torrentverify.py -t my_file.torrent -d /download_dir/ --checkUnneeded --deleteUnneeded

Finally, you can do a comprehensive (and slow) check of your torrent files.

$ ./torrentverify.py -t my_file.torrent -d /download_dir/ --checkHash

Note that --checkHash does not check for unneeded files.

Command line reference

Syntax

torrentverify.py -t file.torrent [-d /download_dir/] [options]

If only the torrent file is input with -t file.torrent then torrent file contents are listed but no other action is performed.

Options

  • -t file.torrent

Torrent filename.

  • -d /download_dir/

Directory where torrent is downloaded. Data directory will be the concatenation of this directory with the torrent internally reported download directory.

  • --otd

Override torrent data directory. Data directory will be the directory specified with -d option and torrent internally reported directory will be ignored.

  • --check

Checks that all the files listed in the torrent file are in the download directory and that their size is correct. This test is very fast but files having wrong checksum are not detected.

  • --truncateWrongSizeFiles

Truncate files whose size is bigger than it should be. This may solve bugs with some torrent clients, specially when older version of the downloaded files are used as starting point to download a new torrent. Use this option in conjuction with --check. After using this option it is recommended you check the SHA1 with --checkHash to make sure everything is OK with your downloaded files.

  • --deleteWrongSizeFiles

Delete files in the torrent download directory whose size is incorrect. Then, you can use your favourite torrent client to recreate (download) them again. Use this option in conjuction with --check.

  • --checkUnneeded

Checks the torrent downloaded files and finds files there not belonging to the torrent.

  • --deleteUnneeded

Deletes unneeded files in the torrent directory. Use this option in conjuction with --checkUnneeded. You will be asked wheter to delete the uneeded files or not for security.

WARNING: this option is dangerous! If you specify the wrong directory you may potentially delete all files in you computer!

  • --checkHash

Checks torrent downloaded files against the SHA1 checksum. This test is slow but reliable. If some files are padded (have extra bytes at the end of the file) SHA1 will pass but files may be incorrect (see --truncateWrongSizeFiles option).

  • --checkFile filename

Checks a single downloaded file against the SHA1 checksum. You must also specify the torrent download directory with -d and optionally you can use --otd.

Core symbols most depended-on inside this repo

limit_string_lentgh
called by 9
torrentverify.py
decode
called by 4
torrentverify.py
confirm_file_action
called by 3
torrentverify.py
pieces_generator
called by 2
torrentverify.py
do_printHelp
called by 2
torrentverify.py
query_yes_no_all
called by 1
torrentverify.py
join_file_byte_list
called by 1
torrentverify.py
extract_torrent_metadata
called by 1
torrentverify.py

Shape

Function 13
Method 10
Class 3

Languages

Python100%

Modules by API surface

torrentverify.py26 symbols

For agents

$ claude mcp add torrentverify \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page