This project is a simple tool for extracting metadata from torrent files. With this script, users can easily access detailed information about torrent files without the need to open a torrent client.
- Quickly and efficiently extract metadata from torrent files.
- Display information such as file name, size, created by, and more.
- Make sure you have Golang installed on your system.
- Clone this repository and install its package by running
git clone https://github.com/thxrhmn/torrent-metadata.git
cd torrent-metadata
go mod tidy
- Run the script by following the command
go run main.go -file <your .torrent file path>
example:
go run main.go -file my.torrent
example result:
{
"name": "My Torrent File",
"created_by": "@thxrhmn",
"creation_date": 1704957362,
"announce": "udp://example.com:6969/announce",
"announce_list": [
"udp://example.com:6969/announce",
"udp://example.com:6970/announce",
],
"size": {
"0": 1000000000,
"1": "1.0 GB"
},
"piece_length": {
"0": 4194304,
"1": "4.2 MB"
},
"total_files": 2,
"files": [
{
"length": {
"0": 122,
"1": "122 B"
},
"path": "0. website.url"
},
{
"length": {
"0": 1000000000,
"1": "1.0 GB"
},
"path": "1. video.mp4"
}
]
}