4

I have a question about the torrent file. I know that it contains a list of servers (users) that I need to connect to, for downloading part of the whole file.

my question is if this is all what the torrent contains? there are more important details?

thanks!

user1673206
  • 1,671
  • 1
  • 23
  • 43

1 Answers1

4

A torrent file is a specially formatted binary file. It always contains a list of files and integrity metadata about all the pieces, and optionally contains a list of trackers.

A torrent file is a bencoded dictionary with the following keys:

announce - the URL of the tracker
info - this maps to a dictionary whose keys are dependent on whether one or more files are being shared:
    name - suggested file/directory name where the file(s) is/are to be saved
    piece length - number of bytes per piece. This is commonly 28KiB = 256 KiB = 262,144 B.
    pieces - a hash list. That is, a concatenation of each piece's SHA-1 hash. As SHA-1 returns a 160-bit hash, pieces will be a string whose length is a multiple of 160-bits.
    length - size of the file in bytes (only when one file is being shared)
    files - a list of dictionaries each corresponding to a file (only when multiple files are being shared). Each dictionary has the following keys:
        path - a list of strings corresponding to subdirectory names, the last of which is the actual file name
        length - size of the file in bytes.
Glen Morse
  • 2,437
  • 8
  • 51
  • 102
  • A torrent file is a bencoded dictionary with `at least` the following keys: `announce` and `info`. Other keys include: `announce-list, comment, create by, creation date, encoding, rss, url-list, website`. – Deanie Oct 19 '15 at 14:34
  • I also forgot about `nodes, publisher` and `publisher-url`. – Deanie Oct 19 '15 at 14:46