在 Bittorrent 中获取 IP 地址

发布于 2024-08-28 22:40:03 字数 543 浏览 4 评论 0原文

我正在尝试获取提供或下载文件的 IP 地址列表。我所做的是联系像 openbittorrent.com 这样的跟踪器来获取以下信息(作为抓取文件的一部分):

B%00%00%0C%5F%B1%B1l%CAGa%84S%CB%B0%9BG%84%3BE:0:1

现在,开头的长字符串是信息哈希。下一步,我这样做了:

http://tracker.sometracker.com/announce?info_hash=B%00%00%0C%5F%B1%B1l%CAGa%84S%CB%B0%9BG%84%3BE

它给了我以下信息。到目前为止,一切都很好。该消息包含以下内容:

d8:completei0e10:downloadedi0e10:incompletei2e8:intervali1931e12:min intervali965e5:peers12:U���ٿ��ӣǣ^@^@e

有人可以告诉我在此之后我应该做什么才能获取当前提供文件或下载文件的 IP 地址吗?

I am trying to get a list of IP addresses serving or downloading a file. What I did was to contact a tracker like openbittorrent.com to get the following (as part of the scrape file):

B%00%00%0C%5F%B1%B1l%CAGa%84S%CB%B0%9BG%84%3BE:0:1

Now, the long string in the beginning is the info hash. As a next step, I did this:

http://tracker.sometracker.com/announce?info_hash=B%00%00%0C%5F%B1%B1l%CAGa%84S%CB%B0%9BG%84%3BE

It gave me back the following. So far so good. The message contained this:

d8:completei0e10:downloadedi0e10:incompletei2e8:intervali1931e12:min intervali965e5:peers12:U���ٿ��ӣǣ^@^@e

Can someone tell me what should I be doing after this to get the IP addresses currently serving the file or downloading it?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

守望孤独 2024-09-04 22:40:03

这不是一个种子文件,而是一个公告响应。它们都是 bencode(使用 bencode 来解码它们),但公告响应包含仅同行信息。这些信息不足以下载 torrent 的内容:为此,您需要 torrent 文件本身。

bencoded 字典的 peers 成员包含 6 个字节的组,您可以使用 struct 解压它们。前四个字节是 IP 地址,后两个字节是端口。这是一个紧凑的公告响应,很常见(但显然仅限 IPv4)。您还可能会看到非紧凑的响应,这为您提供了透明的字典。

如今,许多跟踪器不会通过您发送的非特定抓取公告或不包含 compactport 或 <代码>事件。在继续之前,您可能应该先阅读一下协议

That's not a torrent file, that's an announce response. They're both bencode (use bencode to decode them), but the announce response contains only peer information. That's not enough information to be able to download the contents of the torrent: to do that you will need the torrent file itself.

The peers member of the bencoded dictionary contains groups of 6 bytes which you can unpack with struct. First four bytes are the IP address, followed by two bytes for the port. This is a compact announce response, which is common (but IPv4 only, obviously). You may also see non-compact responses which give you a transparent dictionary.

Many trackers today won't talk to you with the non-specific scrape announce you're sending, or the initial announce request that doesn't include compact, port or event. You should probably read over the protocol a bit before going further.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文