Skip to main content
fix typo
Source Link
fbdtemme
  • 151
  • 1
  • 3

DisclamerDisclaimer: I am the author of this tool.

Disclamer: I am the author of this tool.

Disclaimer: I am the author of this tool.

Source Link
fbdtemme
  • 151
  • 1
  • 3

You can use torrenttools.

torrenttools info test.torrent

Metafile: /home/fbdtemme/Downloads/Fedora-Workstation-Live-x86_64-33.torrent Protocol version: v1 Infohash: 7707056a138a00dd9b9eff4fab29f46233e2bad9 Piece size: 256 KiB (262144 bytes) Created by: Created on: 2020-10-26 15:52:05 UTC Private: false Name: Fedora-Workstation-Live-x86_64-33 Source: Comment: Announces: tier 1 - http://torrent.fedoraproject.org:6969/announce Files: Fedora-Workstation-Live-x86_64-33 ├── [1.04 KiB] Fedora-Workstation-33-1.2-x86_64-CHECKSUM └── [1.91 GiB] Fedora-Workstation-Live-x86_64-33-1.2.iso 1.91 GiB in 0 directories, 2 files 

You can also retrieve specific fields only which can be useful in shell scripts.

torrenttools show infohash test.torrent

17ebe3685a498afcc06e2241e875a1726e7c38c2 

torrenttools show announce Fedora-Workstation-Live-x86_64-33.torrent

http://torrent.fedoraproject.org:6969/announce 

It can be useful to view the decoded torrent file in json format.

torrenttools info --raw Fedora-Workstation-Live-x86_64-33.torrent

{ "announce": "http://torrent.fedoraproject.org:6969/announce", "creation date": 1603727525, "info": { "files": [ { "length": 1062, "path": [ "Fedora-Workstation-33-1.2-x86_64-CHECKSUM" ] }, { "length": 2049490944, "path": [ "Fedora-Workstation-Live-x86_64-33-1.2.iso" ] } ], "name": "Fedora-Workstation-Live-x86_64-33", "piece length": 262144, "pieces": "<7819 piece hashes>" } } 

You can expand the pieces field with the --show-pieces options.

torrenttools info --raw --show-pieces Fedora-Workstation-Live-x86_64-33.torrent

{ "announce": "http://torrent.fedoraproject.org:6969/announce", "creation date": 1603727525, "info": { "files": [ { "length": 1062, "path": [ "Fedora-Workstation-33-1.2-x86_64-CHECKSUM" ] }, { "length": 2049490944, "path": [ "Fedora-Workstation-Live-x86_64-33-1.2.iso" ] } ], "name": "Fedora-Workstation-Live-x86_64-33", "piece length": 262144, "pieces": [ "<piece: 0, SHA1: 52095a748e9337d31631fce7fe6d7d5a40f60352>", "<piece: 1, SHA1: 5a241db1f3d0e6b794d04594253b5c1931cacafe>", "<piece: 2, SHA1: 06adbe76ca7764c142fd2c00f57fab5dc7667171>", "<piece: 3, SHA1: 40893918608f042fe41abcc4e4f4e04f92ad3665>", "<piece: 4, SHA1: 0b491f424e765b64ef38329e1935bd2c3ceff4e0>", "<piece: 5, SHA1: deffa6b0a4ca6b11b04caa785a4ef80b0ee4a238>", ... 

torrenttools can also work with the new BitTorrent v2 metafiles and hybrid torrents.

torrenttools info bittorrent-v2-hybrid-test.torrent

Metafile: /home/fbdtemme/Documents/project/torrent/torrenttools/tests/resources/bittorrent-v2-hybrid-test.torrent Protocol version: v1 + v2 (hybrid) Infohash: v1: 8c9a2f583949c757c32e085413b581067eed47d0 v2: d8dd32ac93357c368556af3ac1d95c9d76bd0dff6fa9833ecdac3d53134efabb Piece size: 512 KiB (524288 bytes) Created by: libtorrent Created on: 2020-06-03 08:45:06 UTC Private: false Name: bittorrent-v1-v2-hybrid-test Source: Comment: Announces: Files: bittorrent-v1-v2-hybrid-test ├── [6.23 MiB] Darkroom (Stellar, 1994, Amiga ECS) HQ.mp4 ├── [19.6 MiB] Spaceballs-StateOfTheArt.avi ├── [ 326 MiB] cncd_fairlight-ceasefire_(all_falls_down)-1080p.mp4 ├── [58.8 MiB] eld-dust.mkv ├── [ 265 MiB] fairlight_cncd-agenda_circling_forth-1080p30lq.mp4 ├── [42.5 MiB] meet the deadline - Still _ Evoke 2014.mp4 ├── [61.0 B] readme.txt ├── [25.1 MiB] tbl-goa.avi └── [ 111 MiB] tbl-tint.mpg 854.06 MiB in 0 directories, 9 files 

Disclamer: I am the author of this tool.

For more information see: