BT seed file format

zhaozj2021-02-11  209

BT seed file format

The BT seed file uses a coding method called Bencoding to save data. Bencoding has four types of data: SRINGS, Integers, Lists, Dictionaries (Dictionary) encoding rules: strings encoded as: : For example: 4: Test is represented as a string "test" 4: example is expressed as a string "example" string length unit is not started or end tags

Integers encoding: i e Start tag i, the end tag is e, for example: I1234E is expressed as an integer 1234 I-1234E to indicate an integer -1234 integer without size limit I0E is expressed as an integer 0 I-0E is illegal 0 The beginning is illegal as: I01234E is illegal

Lists encoding: L e Start tagging to L, end tags can contain any Bencoding encoding type, including integers, strings, lists, and dictionaries. For example: L4: Test5abcdee is expressed as two strings ["test", "abcde"]

Dictionaries (Dictionary) encoded as D E Start tagging as d, ending the tagged E-key must be a Bencoding string value for any Bencoding coding type, for example: D3: agei20ee is expressed {" AGE "= 20} D4: Path3: C: / 8: filename8: test.txte is expressed as {" path "=" c: / "," filename "=" test.txt "}

The specific file structure is as follows: All content must be the Bencoding coding type. The entire file is a dictionary structure, including the following keyword Announce: Tracker server URL (Optional) Announce-list (optional TRACKER server list (list) Creation Date (optional): Time created by seed, UNIX standard Time format, from 1970 January 1 00:00:00 to the number of seconds (integer) Comment (Optional): Remarks (Optional): Create a man or create a program information (character Strings) Info: a dictionary structure, the main information of the file, is divided into two cases: single file structure or multi-file structure single file structure is as follows: Length: File length, unit byte (integer) MD5SUM (optional): Long 32 characters of the MD5 checksum, BT does not use this value, just to be reserved for some programs! (String) Name: file name (string) Piece Length: Size, unit bytes of each block ( Integer) PIECES: 20 bytes of each block (binary format) multi-file structure is as follows: FILES: a dictionary structure Length: File length, unit byte (integer) MD5SUM (optional): The same path and name in the file structure: the path and name of the file, is a list structure, such as the /test/test.txt list is L4: Test8Test.txte name: The top of the directory name (string) Piece Length: in the same single file structure The same example: The same example in the same single file structure: Open one with Notepad. Tort can look like the following D8: Announce35: http://www.manfen.net: 7802 / announce13: creation datei1076675108e4: infod6: lengthi17799e4: Name62 : Microsoft.windows.2000.and.nt4.source.code-sceneleader.torrent12: pieneleader.torrent12: pieces 20:? W ? 躐? 緕 緕 T 酆 EE easy to see Announce = http://www.manfen.net : 78 02 / announcecreation date = 1076675108 seconds (02/13/04 20:25:08) file name = microsoft.windows.2000.nd.nt4.source.code-sceneleader.torrent file size = 17799 byte file block size = 32768 byte

转载请注明原文地址:https://www.9cbs.com/read-4947.html

New Post(0)