7

Using a torrent file from

http://torrent.ubuntu.com:6969/

I am calculating its hash which matches with the hash on the page.

Then i make a request to the tracker. Like

http://torrent.ubuntu.com:6969/announce?info_hash=9a81333c1b16e4a83c10f3052c1590aadf5e2e20

But i get

d14:failure reason63:Requested download is not authorized for use with this tracker.e

According to the spec this should work?

Tracker Spec General Spec

Dirk Vollmar
  • 172,527
  • 53
  • 255
  • 316
Hamza Yerlikaya
  • 49,047
  • 44
  • 147
  • 241

1 Answers1

6

You specified the info_hash in hex, rather than URL-encoding. The bytes of the SHA-1 hash should be encoded directly, like this:

http://torrent.ubuntu.com:6969/file?info_hash=%9A%813%3C%1B%16%E4%A8%3C%10%F3%05%2C%15%90%AA%DF%5E.%20

Also, for the announce URL, some additional parameters like peer_id are usually required.

mark4o
  • 58,919
  • 18
  • 87
  • 102
  • 2
    Thx, can you be more specific as to how you come up with the encoding? i assumed since there are no non-ascii chars in the hash i should not have to escape it. Did you encode the bytes from the sha-1? – Hamza Yerlikaya Jun 19 '09 at 19:24
  • Thank you, I have just noticed that i make your request to file not announce, if i change info to announce i get id not 20 bytes long error. should i make my request against file not announce? – Hamza Yerlikaya Jun 19 '09 at 21:29
  • 1
    "file" is for downloading the torrent file; I used that because it requires only the info_hash parameter. For "announce", many more parameters are required; the error you are getting is because you are missing peer_id. Here is a working announce URL for this torrent: http://torrent.ubuntu.com:6969/announce?info_hash=%9A%813%3C%1B%16%E4%A8%3C%10%F3%05%2C%15%90%AA%DF%5E.%20&peer_id=ABCDEFGHIJKLMNOPQRST&port=6881&uploaded=0&downloaded=0&left=727955456&event=started&numwant=100&no_peer_id=1&compact=1 – mark4o Jun 19 '09 at 21:59
  • Thanks url helped me a lot in putting togerher a working request. – Hamza Yerlikaya Jun 19 '09 at 22:13