Fichier Torrent: Difference between revisions

From Shareaza Wiki
Jump to navigation Jump to search
(Created page with "'''A TRADUIRE''' A '''torrent file''' stores metadata used for BitTorrent. It is defined in the BitTorrent specification. In a conventional Interne...")
 
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
'''A TRADUIRE'''
Un '''fichier torrent''' stocke les [[metadata/fr|métadonnée]] utilisées pour [[BitTorrent/fr|BitTorrent]]. Il est défini dans les spécifications de BitTorrent. Lors d'un téléchargement classique sur Internet, un fichier (ou groupe de fichiers) est transmis d'un ordinateur (généralement un serveur) à un autre ordinateur (un client). Les données sont conservées dans un emplacement centralisé et est récupéré à la demande d'un seul utilisateur.


A '''torrent file''' stores metadata used for [[BitTorrent (protocole)|BitTorrent]]. It is defined in the BitTorrent specification.
Un fichier torrent contient les adresses  internet (URL) de multiples [[BitTorrent/fr#Vocabulaire|trackers]] et l'intégrité des [[metadata/fr|métadonnée]] de toutes les pièces composant le téléchargement. Il peut également contenir des métadonnées supplémentaires définis dans les extensions de la spécification BitTorrent. Connus sous l'appellation "''BitTorrent Enhancement Proposals''" (Propositions Accessoires BitTorrent). Par exemple une de ces propositions de métadonnée accessoire est d'indiquer qui a créé le torrent et quand...
In a conventional Internet download, a file or group of files is transmitted from one computer (usually a server) to another computer (a client). Data is held in a central location and is retrieved per the request of a single user.


A torrent, however, distributes data differently on many levels. Firstly, a .torrent file is not the actual file being retrieved. The .torrent file is merely data which has information about the file that the user is seeking. The .torrent file is, in a sense, a sort of index of the file being retrieved. The torrent divides the target file into a series of equally sized pieces that are each assigned an identifying checksum.
==Structure du fichier==
Un fichier torrent est un dictionnaire [http://fr.wikipedia.org/wiki/Bencode bencode] avec les clés suivantes :


The transfer of the torrent file is done between many different peers. Rather than the data being transferred from one machine to the next, the various pieces of the file are held on many different computers. The torrent client communicate with other peers in order to check which pieces they have and exchanges them for the ones they need. In this way, transferring files via a torrent is sort of like a lightning fast, digitally automated game of "Go Fish." Peers swap pieces of files with as many different computers as possible and eventually combine the various parts into the whole, requested file.
* '''<tt>announce</tt>''' - L'adresse du tracker
* '''<tt>info</tt>''' - cela correspond à un dictionnaire dont les clés sont à charge si un ou plusieurs fichiers sont partagés:
** '''<tt>name</tt>''' - suggère le nom de répertoire où le(s) fichier(s) doit/doivent être sauvé
** '''<tt>piece length</tt>''' - Nombre d’octet par morceaux. Cela est communément <math>2^{18}</math> = 256Kio = 262144B.
** '''<tt>pieces</tt>''' - concaténation de chaque pièce du hache [http://fr.wikipedia.org/wiki/SHA-1 SHA-1]. Si SHA-1 retourne un hache de 160-bit, '''<tt>pieces</tt>''' sera une chaîne dont la longueur est un multiple de 160-bits
** '''<tt>length</tt>''' - Taille du fichier (en octet) seulement quand un seul fichier est partagé.
** '''<tt>files</tt>''' - une liste de dictionnaires (chaque dictionnaire correspond à un fichier) avec les clés suivantes :
*** '''<tt>path</tt>''' - une liste de chaînes correspondant à des noms de sous-répertoires, dont le dernier est le nom du fichier
*** '''<tt>length</tt>''' - Taille du fichier (en octet).


A torrent file contains the URLs of multiple [[BitTorrent tracker|trackers]] and integrity metadata about all the pieces. It can also contain additional metadata defined in extensions to the BitTorrent specification.<ref>{{cite web|url=http://www.bittorrent.org/beps/bep_0000.html |title=BEP-0000: Index of BitTorrent Enhancement Proposals |publisher=Bittorrent.org |date= |accessdate=2009-10-22}}</ref> These are known as "BitTorrent Enhancement Proposals". Examples of such proposals include metadata for stating who created the torrent, and when.
Toutes les chaînes doivent être codées en UTF-8.


==File structure==
==Exemples==
A torrent file is a [[bencode]]d dictionary with the following keys:
* <tt>announce</tt> - the URL of the tracker
* <tt>info</tt> - this maps to a dictionary whose keys are dependent on whether one or more files are being shared:
** <tt>name</tt> - suggested file/directory name where the file(s) is/are to be saved
** <tt>piece length</tt> - number of bytes per piece. This is commonly <math>2^{18}</math> = 256KiB = 262144B.
** <tt>pieces</tt> - concatenation of each piece's [[SHA-1]] hash. As SHA-1 returns a 160-bit hash, <tt>pieces</tt> will be a string whose length is a multiple of 160-bits.
And exactly one of <tt>length</tt> (corresponds to when only one file is being shared) or <tt>files</tt> (corresponds to when multiple files are being shared):
** <tt>length</tt> - size of the file (in bytes)
** <tt>files</tt> - a list of dictionaries (each dictionary corresponds to a file) with the following keys:
*** <tt>path</tt> - a list of strings corresponding to subdirectory names, the last of which is the actual file name
*** <tt>length</tt> - size of the file (in bytes).


All strings must be UTF-8 encoded.
===Torrent à un seul fichier===
Voici un fichier torrent de-bencoded avec <tt>piece length</tt> 256Kio = 262144 octets pour un fichier <tt>debian-503-amd64-CD-1.iso</tt> dont la taille est 647 Mio = 678301696 octet) :


==Extensions==
===Draft extensions===
These [[extensions]] are under consideration for standardization.
====Distributed hash tables====
BEP-0005<ref>{{cite web|url=http://www.bittorrent.org/beps/bep_0005.html |title=BEP-0005: DHT Protocol |publisher=Bittorrent.org |date= |accessdate=2009-10-22}}</ref> extends BitTorrent to support [[distributed hash table]]s.
A trackerless torrent dictionary does not have an <tt>announce</tt> key. Instead, a trackerless torrent has a <tt>nodes</tt> key:
{
...
'nodes': [["<host>", <port>], ["<host>", <port>], ...]
...
}
For example,
'nodes': [["127.0.0.1", 6881], ["your.router.node", 4804]]
The specification recommends that <tt>nodes</tt> "should be set to the K closest nodes in the torrent generating client's routing table. Alternatively, the key could be set to a known good node such as one operated by the person generating the torrent."
====Multiple trackers====
BEP-0012<ref>{{cite web|url=http://www.bittorrent.org/beps/bep_0012.html |title=BEP-0012: Multitracker Metadata Extension |publisher=Bittorrent.org |date= |accessdate=2009-10-22}}</ref> extends BitTorrent to support multiple trackers.
A new key, <tt>announce-list</tt>, is placed in the top-most list (i.e. with <tt>announce</tt> and <tt>info</tt>). This key's value is a list of tracker "tiers". Each tier is a list of URLs:
{
...
'announce-list': [["<nowiki>http://tracker.site1.com/announce</nowiki>"], ["<nowiki>http://tracker.site2.com/announce</nowiki>"]]
...
}
====HTTP seeds====
BEP-0017<ref>{{cite web|url=http://www.bittorrent.org/beps/bep_0017.html |title=BEP-0017: HTTP Seeding |publisher=Bittorrent.org |date= |accessdate=2009-10-22}}</ref> extends BitTorrent to support HTTP seeds.
A new key, <tt>httpseeds</tt>, is placed in the top-most list (i.e. with <tt>announce</tt> and <tt>info</tt>). This key's value is a list of web addresses where torrent data can be retrieved:
{
...
'httpseeds': ['<nowiki>http://www.site1.com/source1.php</nowiki>', '<nowiki>http://www.site2.com/source2.php</nowiki>']
...
}
====Private torrents====
BEP-0027<ref>{{cite web|url=http://www.bittorrent.org/beps/bep_0027.html |title=BEP-0027: Private Torrents |publisher=Bittorrent.org |date= |accessdate=2009-10-22}}</ref> extends BitTorrent to support private torrents.
A new key, <tt>private</tt>, is placed in the <tt>info</tt> dictionary. This key's value is 1 if the torrent is private:
{
...
'private': 1
...
}
====Merkle trees====
BEP-0030<ref>{{cite web|url=http://www.bittorrent.org/beps/bep_0030.html |title=BEP-0030: Merkle hash torrent extension |publisher=Bittorrent.org |date= |accessdate=2009-10-22}}</ref> extends BitTorrent to support [[Merkle trees]].
A torrent file using Merkle trees does not have a <tt>pieces</tt> key in the <tt>info</tt> list. Instead, such a torrent file has a <tt>root hash</tt> key in the <tt>info</tt> list. This key's value is the root hash of the Merkle hash:
{
...
'info': {
...
'root hash': e6bdebcc5d55da0a77f4bb1b57d88de794838577
...
}
...
}
==Examples==
===Single file===
Here is what a de-bencoded torrent file (with <tt>piece length</tt> 256KiB = 262144 bytes) for a file <tt>debian-503-amd64-CD-1.iso</tt> (whose size is 647MiB = 678301696 bytes) might look like:
  {'announce': 'http://bttracker.debian.org:6969/announce'
  {'announce': 'http://bttracker.debian.org:6969/announce'
  'info': {'name': 'debian-503-amd64-CD-1.iso',
  'info': {'name': 'debian-503-amd64-CD-1.iso',
Line 100: Line 30:
  }
  }
  }
  }
Note: <tt>pieces</tt> here would be a ceil(<tt>length</tt>/<tt>piece length</tt>) * 160-bit = ceil(678301696/262144) * 160-bit = ceil(2587.515625) * 160-bit = 2588 * 160-bit = 414080-bit = 51KiB value.
Remarque : <tt>pieces</tt> est ici un plafond(<tt>length</tt>/<tt>piece length</tt>) * 160-bit = plafond(678301696/262144) * 160-bit = plafond(2587.515625) * 160-bit = 2588 * 160-bit = 414080-bit = 51Kio.


===Multiple files===
===Torrent à fichiers Multiples===
Here is what a de-bencoded torrent file (with <tt>piece length</tt> 256KiB = 262144) for two files, 111.txt & 222.txt, might look like:
 
Voici un fichier torrent de-bencoded avec <tt>piece length</tt> 256Kio = 262144) pour deux fichiers : 111.txt & 222.txt :
  {'announce': 'http://tracker.site1.com/announce',
  {'announce': 'http://tracker.site1.com/announce',
  'info: {'name': 'directoryName',
  'info: {'name': 'directoryName',
Line 114: Line 45:
  }
  }


==References==
==Références==
{{reflist}}
 
==External links==
* [http://www.bittorrent.org/beps/bep_0003.html Official BitTorrent Specification]
* [http://wiki.theory.org/BitTorrentSpecification#Metainfo_File_Structure Unofficial documentation of BitTorrent and its extensions]


{{BitTorrent}}
Source : http://en.wikipedia.org/wiki/Torrent_file

Latest revision as of 19:51, 12 April 2014

Un fichier torrent stocke les métadonnée utilisées pour BitTorrent. Il est défini dans les spécifications de BitTorrent. Lors d'un téléchargement classique sur Internet, un fichier (ou groupe de fichiers) est transmis d'un ordinateur (généralement un serveur) à un autre ordinateur (un client). Les données sont conservées dans un emplacement centralisé et est récupéré à la demande d'un seul utilisateur.

Un fichier torrent contient les adresses internet (URL) de multiples trackers et l'intégrité des métadonnée de toutes les pièces composant le téléchargement. Il peut également contenir des métadonnées supplémentaires définis dans les extensions de la spécification BitTorrent. Connus sous l'appellation "BitTorrent Enhancement Proposals" (Propositions Accessoires BitTorrent). Par exemple une de ces propositions de métadonnée accessoire est d'indiquer qui a créé le torrent et quand...

Structure du fichier

Un fichier torrent est un dictionnaire bencode avec les clés suivantes :

  • announce - L'adresse du tracker
  • info - cela correspond à un dictionnaire dont les clés sont à charge si un ou plusieurs fichiers sont partagés:
    • name - suggère le nom de répertoire où le(s) fichier(s) doit/doivent être sauvé
    • piece length - Nombre d’octet par morceaux. Cela est communément <math>2^{18}</math> = 256Kio = 262144B.
    • pieces - concaténation de chaque pièce du hache SHA-1. Si SHA-1 retourne un hache de 160-bit, pieces sera une chaîne dont la longueur est un multiple de 160-bits
    • length - Taille du fichier (en octet) seulement quand un seul fichier est partagé.
    • files - une liste de dictionnaires (chaque dictionnaire correspond à un fichier) avec les clés suivantes :
      • path - une liste de chaînes correspondant à des noms de sous-répertoires, dont le dernier est le nom du fichier
      • length - Taille du fichier (en octet).

Toutes les chaînes doivent être codées en UTF-8.

Exemples

Torrent à un seul fichier

Voici un fichier torrent de-bencoded avec piece length 256Kio = 262144 octets pour un fichier debian-503-amd64-CD-1.iso dont la taille est 647 Mio = 678301696 octet) :

{'announce': 'http://bttracker.debian.org:6969/announce'
'info': {'name': 'debian-503-amd64-CD-1.iso',
'piece length': 262144,
'length': 678301696,
'pieces': '841ae846bc5b6d7bd6e9aa3dd9e551559c82abc1 ... d14f1631d776008f83772ee170c42411618190a4'
}
}

Remarque : pieces est ici un plafond(length/piece length) * 160-bit = plafond(678301696/262144) * 160-bit = plafond(2587.515625) * 160-bit = 2588 * 160-bit = 414080-bit = 51Kio.

Torrent à fichiers Multiples

Voici un fichier torrent de-bencoded avec piece length 256Kio = 262144) pour deux fichiers : 111.txt & 222.txt :

{'announce': 'http://tracker.site1.com/announce',
'info: {'name': 'directoryName',
'piece length': 262144,
'files': [ {'path': '111.txt', 'length': 111},
{'path': '222.txt', 'length': 222}
],
'pieces': '6a8af7eda90ba9f851831073c48ea6b7b7e9feeb...8a43d9d965a47f75488d3fb47d2c586337a20b9f'
}
}

Références

Source : http://en.wikipedia.org/wiki/Torrent_file