I am interested in rendering a torrent file into a readable form (to see what files does it reference, what tracker information does it contain etc.). What a tool can I use to do just this?


btshowmetainfo, formerly included in the BitTorrent distribution but now largely installed with BitTornado (a fork of the BitTorrent 3.x codebase), does just that.

$ btshowmetainfo amd64cd-5.1.2.iso.torrent 
btshowmetainfo 20030621 - decode BitTorrent metainfo files

metainfo file.: amd64cd-5.1.2.iso.torrent
info hash.....: e30c05f2330ba4869eefb90bf5978a505303b235
file name.....: amd64cd-5.1.2.iso
file size.....: 253325312 (966 * 262144 + 94208)
announce url..: http://tracker.netbsd.org:6969/announce
|improve this answer|||||
  • 3
    You can clone https://github.com/effigies/BitTornado and run python3 btshowmetainfo.py to run the script, since BitTornado seems long-since abandoned. – zymhan Dec 9 '16 at 14:01

You can use transmission-show, included in the Gnome Transmission BitTorrent client.

$ transmission-show amd64cd-5.1.2.iso.torrent
Name: amd64cd-5.1.2.iso
File: amd64cd-5.1.2.iso.torrent


  Name: amd64cd-5.1.2.iso
  Hash: e30c05f2330ba4869eefb90bf5978a505303b235
  Created by: 
  Created on: Sun Feb  5 01:31:29 2012
  Piece Count: 967
  Piece Size: 256.0 KiB
  Total Size: 253.3 MB
  Privacy: Public torrent


  Tier #1


  amd64cd-5.1.2.iso (253.3 MB)

If you're using an older version of Transmission, you can use the older transmissioncli --info command:

$ transmissioncli --info amd64cd-5.1.2.iso.torrent
Transmission 2.03 (11030) - http://www.transmissionbt.com/
hash:   e30c05f2330ba4869eefb90bf5978a505303b235
name:   amd64cd-5.1.2.iso

tracker tier #1:
        announce:       http://tracker.netbsd.org:6969/announce
size:   253325312 (966 * 262144 + 94208)
        amd64cd-5.1.2.iso (253325312)
|improve this answer|||||
  • -1 my version of transmission-cli (2.51 Debian testing amd64) does not have this option – ixtmixilix May 17 '12 at 23:48
  • @ixtmixilix: Answer updated to use new "transmission-show" command. – Teddy May 24 '12 at 16:54
  • 4
    For archlinux users, this is in extra/ as of April 2017. Win – g33kz0r Apr 9 '17 at 21:51
  • Is there a way to get transmission-show output to include exact file size? Useful to see if 2 torrents of the same thing might not be the exact same file after all. – Peter Cordes Oct 4 '19 at 19:55

You can use aria2.  From the aria2c(1) man page:

-S, --show-files[=true|false]

    Print file listing of ".torrent", ".meta4" and ".metalink" file and exit. In case of ".torrent" file, additional information (infohash, piece length, etc) is also printed.

$ aria2c -S ubuntu-14.04.2-desktop-i386.iso.torrent 
>>> Printing the contents of file 'ubuntu-14.04.2-desktop-i386.iso.torrent'...
*** BitTorrent File Information ***
Comment: Ubuntu CD releases.ubuntu.com
Creation Date: Thu, 19 Feb 2015 22:17:32 GMT
Mode: single
Info Hash: 33678ec8b0dfb8a9061348c8af7194268c0b8310
Piece Length: 512KiB
The Number of Pieces: 2006
Total Length: 0.9GiB (1,051,721,728)
Name: ubuntu-14.04.2-desktop-i386.iso
Magnet URI: magnet:?xt=urn:btih:33678EC8B0DFB8A9061348C8AF7194268C0B8310&dn=ubuntu-14.04.2-desktop-i386.iso&tr=http%3A%2F%2Ftorrent.ubuntu.com%3A6969%2Fannounce&tr=http%3A%2F%2Fipv6.torrent.ubuntu.com%3A6969%2Fannounce
   |0.9GiB (1,051,721,728)
|improve this answer|||||
  • it support glob pattern, aria2c -S *.torrent works. – Oboo Cheng Aug 16 '19 at 11:08

lstor, including the ability to calculate the hash, which can be quite useful in shell scripts:

$ lstor Chakra\ 2012.02\ Archimedes\ x86.torrent -qo __hash__

$ lstor Chakra\ 2012.02\ Archimedes\ x86.torrent -q
NAME Chakra 2012.02 Archimedes x86.torrent
SIZE 1.4 GiB (1461 * 1.0 MiB + 0 bytes)
HASH B3472076574BC666396766AB3B28C0054D740B46
URL  http://linuxtracker.org:2710/********************************/announce
PRV  YES (DHT/PEX disabled)
TIME 2012-02-13 17:10:28
BY   qBittorrent v2.9.3

chakra-2012.02-Archimedes-i686.iso                                      1.4 GiB

$ lstor Chakra\ 2012.02\ Archimedes\ x86.torrent -q --raw
{'announce': 'http://linuxtracker.org:2710/********************************/announce',
 'created by': 'qBittorrent v2.9.3',
 'creation date': 1329149428,
 'info': {'length': 1531969536,
          'name': 'chakra-2012.02-Archimedes-i686.iso',
          'piece length': 1048576,
          'pieces': '<1461 piece hashes>',
          'private': 1},
 'url-list': ''}
|improve this answer|||||

You can use Torrent File Editor Files tab
(source: fsdn.com)
Raw tab

Also .torrent file can be converted to .json format with command line --to-json.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.