views:

55

answers:

2

hello, how can i get the torrent peers from an tracker ..... say i have

hash value 76a36f1d11c72eb5663eeb4cf31e351321efa3a3

and an tracker info as http://tracker.openbittorrent.com/announce how can i get the peers

+2  A: 

Check the protocol specification.

Maerlyn
ya but if i use http://tracker.openbittorrent.com/announce?info_hash=76a36f1d11c72eb5663eeb4cf31e351321efa3a3it shows error...
rap
@rap if you check the link I gave you you'll see your example lacks many required parameters, like the peer_id or the event. No wonder it's an invalid request.
Maerlyn
Not only that, you have to send the actual value of the hash as a GET parameter. "76a36f1d11c72eb5663eeb4cf31e351321efa3a3" is a **hexadecimal representation** of the hash, but the tracker protocol specifies that you need to send **the value of the hash** (=bytestring). So you have to first decode the hexadecimal representation and then URL encode it: `urllib.urlencode( [('info_hash', '76a36f1d11c72eb5663eeb4cf31e351321efa3a3'.decode('hex'))] ) == 'info_hash=v%A3o%1D%11%C7.%B5f%3E%EBL%F3%1E5%13%21%EF%A3%A3' # in Python.`
ShinNoNoir
A: 

You may have the most luck dissecting libtorrent (in any of its forks/languages) and seeing how they do it.

David