Domanda

I'm trying to send a HTTP get request to a tracker. But I don't know where the info_hash and peer_id are and I need them as parameters. According to bittorent specifications the info_hash is the metafile's info "info_hash: urlencoded 20-byte SHA1 hash of the value of the info key from the Metainfo file."and the peer_id "is allowed to be any value"

But when I put the properly URL encoded info key as the info_hash, and arbitrarly put something for the peer_id I get this error: d14:failure reason20:Torrent unauthorisede

Can someone give me an example where the info_hash is in this file?

d8:announce40:http://tracker.the123ay.org/announce13:announce-listll40:http://tracker.th213bay.org/announceel35:udp://tracker.op123rrent.com:80el23:udp://tr123ker.ccc.de:80el29:udp://tracker.pawscbt.com:80el46:udp://tracker.tntvadse.scambioetico.org:2710ee7:comment46:Torrent downloaded from http://theadsde10:created by13:uTorrent/332013:creation datei1391719112e8:encoding5:UTF-84:infod13:file-durationli2462ei2474ee10:file-mediali0ei0ee5:filesld6:lengthi1443259870e4:pathl70:Casdasd7.Problemi.Di.Famiglia.ITA.720p.DLMux.h264-Noasdip.mkveed6:lengthi1461542146e4:pathl70:Chicaasdasx08.Una.Scelta.Difficile.ITA.720p.DLMux.h264-NovaRip.mkveee4:name48:Chicago.Fire.1x07-08.ITA.720p.DLMux.h264-NovaRip12:piece lengthi262144e6:pieces221620:

Using Java if it matters. Lmk if I need to give more info.

È stato utile?

Soluzione

The info dictionary in your example starts at

infod13:

You must determine the info data and calculate the SHA1 of the info data. After that you must to URL encode the SHA1.

info_hash: urlencoded 20-byte SHA1 hash of the value of the info key from the Metainfo file. Note that the value will be a bencoded dictionary, given the definition of the info key above.

description

There is an example written in Qt which i think it might help you. (Qt5.2.1/5.2.1/gcc_64/examples/network/torrent) You can find it online here qt torrent

Edit: Here is a good answer for what you are looking for Calculating the info-hash of a torrent file

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top