|2004-02-07, 04:30||Link #2|
Join Date: May 2003
Location: Galactic Sector ZZ9 Plural Z Alpha
.torrent files (the files that hold the metainfo data for a BitTorrent download) are downloaded by sending a regular HTTP request to a web server.
I'll demonstrate on how to download a .torrent file for Triad's Gunslinger Girl episode 10, hosted on a.scarywater.net. You can do this using telnet or any other app you prefer.
First of all, you query your local DNS server to resolve the domain name a.scarywater.net. It resolves nicely to 184.108.40.206.
You create a connection to that ip address. Usually web servers are running on port 80 (unless otherwise specified). After establishing the connection, you send the following request to the server:
GET /triad/%5BTriad%5D_Gunslinger_Girl_-_10.avi.torrent HTTP/1.0 User-Agent: Wget/1.9.1 Host: a.scarywater.net Accept: */* Connection: Keep-Alive
You may send another string than what I used as the User-Agent, it's your choice.
After that, the web server in question should reply to you with something like this:
HTTP/1.1 200 OK Date: Sat, 07 Feb 2004 09:04:05 GMT Server: Apache/1.3.27 (Unix) mod_gzip/220.127.116.11a Last-Modified: Fri, 06 Feb 2004 21:56:26 GMT ETag: "4cf44a-3753-40240d8a" Accept-Ranges: bytes Content-Length: 14163 Keep-Alive: timeout=15, max=10 Connection: Keep-Alive Content-Type: application/x-bittorrent
After that, the http daemon will send the actual data of the file. You save this data to a local file on your hard disk. When you have the full file safely on your hard disk (with the file size that the Content-Length header suggests), you may safely close the socket and disconnect from the web server.
PS. Hints: 1 2
Last edited by hhaamu; 2004-02-07 at 04:52.