I'm using torrent file (ubuntu-14.04.1-desktop-amd64.iso) from
http://torrent.ubuntu.com:6969/
I calculated it's info-hash and it matches with hash on the site. But when i'm trying to send GET request:
i get:
d14:failure reason63:Requested download is not authorized for use with this tracker.e
I don't understand what i am doing wrong
I generate request this way:
HttpURLConnection connection;
final String INFO_HASH = "info_hash";
final String PEER_ID = "peer_id";
final String PORT = "port";
final String EVENT = "event";
try {
byte[] peerId = new byte[20];
Random rnd = new Random();
rnd.nextBytes(peerId);
URI uri = new URIBuilder(metaInfo.getAnnounce())
.addParameter(INFO_HASH, new String(metaInfo.getInfoHash(), "UTF-8"))
.addParameter(PEER_ID, new String(peerId, "UTF-8"))
.addParameter(PORT, "6881")
.addParameter(EVENT, "started").build();
log.info("Sending request to: " + uri.toURL().toString());
connection = (HttpURLConnection) uri.toURL().openConnection();
} catch (MalformedURLException e) {
throw new RuntimeException("Invalid torrent file: illegal announce in torrent file");
} catch (URISyntaxException e) {
throw new RuntimeException("Couldn't build URI: illegal announce in torrent file");
}