向 Ubuntu 跟踪器发送 Bittorrent HTTP 请求

Sending Bittorrent HTTP request to Ubuntu tracker

我从这里下载了 ubuntu 17.10 的 torrent 文件: https://www.ubuntu.com/download/alternative-downloads

这是里面的内容:

TorrentInfo{Created By: null
Main tracker: http://torrent.ubuntu.com:6969/announce
Comment: Ubuntu CD releases.ubuntu.com
Info_hash: f07e0b0584745b7bcb35e98097488d34e68623d0
Name: ubuntu-17.10.1-desktop-amd64.iso
Piece Length: 524288
Pieces: 2866
Total Size: 1502576640
Is Single File Torrent: true
File List: 
Tracker List: 
http://torrent.ubuntu.com:6969/announce
http://ipv6.torrent.ubuntu.com:6969/announce

我尝试过的:

我发送了:(仅种子信息哈希)

http://torrent.ubuntu.com:6969/announce?info_hash=%f0%7e%0b%05%84%74%5b%7b%cb%35%e9%80%97%48%8d%34%e6%86%23%d0

并收到:

you sent me garbage - id not of length 20

我发送了:(种子信息哈希和我的 peer-id)

http://torrent.ubuntu.com:6969/announce?info_hash=%f0%7e%0b%05%84%74%5b%7b%cb%35%e9%80%97%48%8d%34%e6%86%23%d0&peer_id=%2D%41%5A%35%37%35%30%2D%54%70%6B%58%74%74%5A%4C%66%70%53%48

并收到:

you sent me garbage - invalid literal for long() with base 10: ''


我错过了什么?该规范未指定任何示例。

规格:

https://wiki.theory.org/index.php/BitTorrentSpecification#Tracker_HTTP.2FHTTPS_Protocol

announce 遗漏必填键 port, uploaded, 下载离开
这些密钥加上 info_hashpeer_id,必须在每个 announce 中.

此外,虽然事件键在每个公告
中不是强制性的 第一个 announce 必须包含 'event=started'.

正在尝试:

http://torrent.ubuntu.com:6969/announce?info_hash=%f0%7e%0b%05%84%74%5b%7b%cb%35%e9%80%97%48%8d%34%e6%86%23%d0&peer_id=%2D%41%5A%35%37%35%30%2D%54%70%6B%58%74%74%5A%4C%66%70%53%48&port=6881&uploaded=0&downloaded=0&left=1502576640&event=started

跟踪器响应:

your client is outdated, please upgrade

哦,好吧,还有更多要修复...

来自我的回答:Why does tracker server NOT understand my request? (Bittorrent protocol)

It is because the request string don't have compact=1 in it.
Most tracker require that nowadays. The legacy way is too ineffective.

因此,将 compact=1 添加到 announce:

http://torrent.ubuntu.com:6969/announce?info_hash=%f0%7e%0b%05%84%74%5b%7b%cb%35%e9%80%97%48%8d%34%e6%86%23%d0&peer_id=%2D%41%5A%35%37%35%30%2D%54%70%6B%58%74%74%5A%4C%66%70%53%48&port=6881&uploaded=0&downloaded=0&left=1502576640&event=started&compact=1

跟踪器响应:

d8:completei2134e10:incompletei100e8:intervali1800e5:peers300:[ binary data ... ]e

成功!