bittorrent - 解码Torrent公告

标签 bittorrent

http://p4p.arenabg.com:1337/announce?info_hash=%1a%b2%ceMb%a9%a4n%91%a3%a3%09%7b%ce%bdbH%97%8d%40

当我发送公告时,我收到回复:

当将整个响应解析为 ascii 时,它可以工作,但是对等端仍然被编码:

112 7 55 110 88 35 104 15 73 31 26 97 85 21 75 11 26 97 79 116 48 49 26 97 103 55 47 9 35 39 2 105 62 122 72 85 41 52 3 2 94 65 84 36 6 49 61 118 73 84 127 116 79 68 86 85 44 120 26 97 81 114 116 4 26 97 2 105 12 92 69 33 41 47 124 15 16 6 82 3 96 118 127 78 85 26 72 97 83 108 37 107 59 80 117 39 61 6 113 73 106 110 84 109 1 31 47 68 94 87 33 111 101 41 111 92 119 0 103 9 69 45 97 116 78 124 60 87 122 6 65 92 44 86 70 64 122 77 60 25 73 15 121 104 41 72 13 79 8 121 58 14 106 19 97 71 105 56 114 70 28 56 82 33 20 3 49 49 2 50 7 49 29 66 58 79 52 70 100 99 79 41 8 95 62 76 85 108 53 114 51 77 72 83 70 55 90 85 69 35 43 41 104 35 31 38 97 106 88 31 73 90 1 45 79 69 85 92 109 44 34 89 88 23 18 21 125 81 5 80 85 27 114 13 85 106 56 92 121 54 49 22 116 9 88 66 62 123 92 103 91 5 78 0 4 41 0 0 75 91 82 6 124 96 62 88 26 58 63 49 68 40 123 102 109 127 58 8 25 100 81 41 67 46 74 27 88 106 46 118 118 88 84 114 62 100 53 4 34 90

这就是我拥有的缓冲区。

您收到类似的结果吗?我该如何解析它?

最佳答案

链接:http://p4p.arenabg.com:1337/announce?info_hash=%1a%b2%ceMb%a9%a4n%91%a3%a3%09%7b%ce%bdbH%97%8d%40

给出以下编码响应(二进制数据已替换为“*”并添加了一些空白字符):

d
 8:complete
  i6635e
 10:downloaded
  i177638e
 10:incomplete
  i2014e
 8:interval
  i1950e
 12:min interval
  i975e
 5:peers
  300:**************************************************
      **************************************************
      **************************************************
      **************************************************
      **************************************************
      **************************************************
e  

具有 300 字节二进制字符串作为:对等点未进行编码。它包含 'compact=1' 格式的对等点,在以下位置指定:
[BEP23 - Tracker Returns Compact Peer Lists]以及 [the wiki]

许多跟踪器默认返回紧凑格式。要获取旧格式,请尝试在公告 URL 中包含 compact=0,但这可能不起作用。由于某些跟踪器已放弃对旧格式的支持。

关于bittorrent - 解码Torrent公告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44338733/

相关文章:

python - 从 torrent 文件中提取 SHA1 哈希

php - 如何在 PHP 中知道种子/对等点的数量

java - 如何使用 Java 计算 torrent 的哈希值

python bittorrent 对等协议(protocol)无法连接到任何对等点

java - 为 torrent 计算的 info_hash 不正确

bittorrent - 如何在 uTorrent 中准确计算 torrent 的可用性

python - python libtorrent是否有其他选择?

c# - 使用 Webclient 下载 Torrent 文件的问题

ruby - 使用 ruby​​ 连接到 torrent "swarm"或 DHT

bittorrent - 围绕 Bitfield Torrent 的困惑