小樱 发表于 2024/4/26 23:34

tracker的info_hash参数字段转换成BT种子特征码

tracker的info_hash参数字段转换成BT种子特征码

The tracker is an HTTP/HTTPS service which responds to HTTP GET requests. The requests include metrics from clients that help the tracker keep overall statistics about the torrent. The response includes a peer list that helps the client participate in the torrent. The base URL consists of the "announce URL" as defined in the metainfo (.torrent) file. The parameters are then added to this URL, using standard CGI methods (i.e. a '?' after the announce URL, followed by 'param=value' sequences separated by '&').

Note that all binary data in the URL (particularly info_hash and peer_id) must be properly escaped. This means any byte not in the set 0-9, a-z, A-Z, '.', '-', '_' and '~', must be encoded using the "%nn" format, where nn is the hexadecimal value of the byte. (See RFC1738 for details.)

For a 20-byte hash of \x12\x34\x56\x78\x9a\xbc\xde\xf1\x23\x45\x67\x89\xab\xcd\xef\x12\x34\x56\x78\x9a, hash=123456789abcdef123456789abcdef123456789a
The right encoded form is %124Vx%9A%BC%DE%F1%23Eg%89%AB%CD%EF%124Vx%9A

例子:http://tracker1.itzmx.com:8080/announce?info_hash=%124Vx%9A%BC%DE%F1%23Eg%89%AB%CD%EF%124Vx%9A&peer_id=-BC0207-%5D%F0%94%FDt%EB%23%19%0A%AB%9C%BC&port=22223&natmapped=1&localip=192.168.68.2&port_type=lan&uploaded=0&downloaded=0&left=0&numwant=200&compact=1&no_peer_id=1&key=2951&event=started

特征码为:123456789abcdef123456789abcdef123456789a

页: [1]
查看完整版本: tracker的info_hash参数字段转换成BT种子特征码