Sign In | Sign Up

My Profile

BitComet
26570520
Level:
Score: 14890
Ranking: 55248
Points: 8652

Shortcuts

Categories

Post

BitComet - Torrent File Format
Size: Large, Medium, Small Thu Sep 13, 07 03:51 PM | Category: Help
4

Torrent File Format

The torrent file format below is used in BitComet v0.59 and later.

The content of a metainfo file (the file ending in ".torrent") is a bencoded dictionary, containing the keys listed below. Keys not marked 'optional' are always generated in BitComet:

  • "info": dictionary that describes the file(s) of the torrent. There are two possible forms: one for the case of a 'single-file' torrent with no directory structure, and one for the case of a 'multi-file' torrent, which can contain subdirectory trees.
For the case of the single-file mode:
  • "name": the filename of the file. (string)
  • "length": length of the file in bytes (integer)
For the case of the multi-file mode:
  • "name": the name of the top-most directory in the structure -- the directory which contains all of the files listed in the above files list. (character string)
  • "files": a list of dictionaries, one for each file. Each dictionary in this list contains the following keys:
  • "length": length of the file in bytes (integer)
  • "path": a list containing one or more string elements that together represent the path and filename. Each element in the list corresponds to either a directory name or (in the case of the final element) the filename. For example, a the file "dir1/dir2/file.ext" would consist of three string elements: "dir1", "dir2", and "file.ext". This is encoded as a bencoded list of strings such as l4:dir14:dir28:file.exte Important Notice: BitComet also inlcude empty directory when creating torrent, that is the file name here may be zero-length string.
For both cases:
  • "piece length": number of bytes in each piece (integer)
  • "pieces": string consisting of the concatenation of all 20-byte SHA1 hash values, one per piece (byte string)
  • "publisher": (optional) the name of the torrent creator if do not allow to be changed(string)
  • "publisher-url": (optional) the url of the torrent creator if do not allow to be changed (string)

 

  • "encoding": the string encoding (string), in v0.59 or above is always "UTF-8"
  • "creation date": the creation time of the torrent, in standard Unix epoch format (integer seconds since 1-Jan-1970 00:00:00 UTC)
  • "created by": name and version of the program used to create the .torrent (string), like this: "BitComet/0.59"

 

  • "announce": (optional) The announce URL of the tracker (string)
  • "announce-list": (optional) multitracker list (a list of string)
  • "nodes": (optional) A list of DHT Network nodes, each nodes is encoded as a 2-element list of host(string) and port(integer)
  • "private": (optional) if the torrent is PrivateTorrent(SecureTorrent), that is to announce only in tracker or tracker-list (integer, 0 or 1)

 

  • "publisher": (optional) the name of the torrent creator (string)
  • "publisher-url": (optional) the url of the torrent creator (string)
  • "comment": (optional) free-form textual comments of the author (string)

 

Important Notice: In BitComet v0.58 or before, the string is encoded using MSCB (user's code page), and a ".utf-8" key is added for UTF-8 encoded string. In v0.59, the default encoding is changed to UTF-8 if the user's code page is neither Chinese nor Japanese. BitComet will still keep adding a ".utf-8" key for all string for backward compatibility, e.g. add a "name.utf-8" key to store utf-8 file name. After most of the users upgrade their client a few months later, BitComet may stop adding ".utf-8" key.
The reason why Chinese or Japanese torrent keeps the old format is because most of the torrent site are not prepared for UTF-8 encoding. This situation may last for a rather long time. If you think it is better to move to all UTF-8 string torrent, please email us.

See also:

N/A
Link: http://blog.bitcomet.com/bitcomet/post_413/ ©
Add to favorites | QuoteReport Reads (6938) | Comments (0)

CommentsReload

N/A

TOP
You need to sign in before