简体   繁体   English

洪流跟踪器对每个请求都回复相同的对等ID?

[英]Torrent tracker reply with same peer id for every request?

I'm writing a Java app to look at the trackers listed in a torrent file. 我正在编写一个Java应用程序来查看种子文件中列出的跟踪器。

I send the following: 我发送以下内容:

http://pow7.com/announce?info_hash=%3f%99%79%31%73%27%9e%be%1d%d2%cd%5f%af%98%7c%17%5f%43%89%f3&peer_id=-jT1000-122843C6A4B0&port=6881&downloaded=0&left=0

But it doesn't matter what info_hash I send I either get the same peers ip address back (74.253.253.31:6757) or an error. 但是,无论我发送的是什么info_hash,都可以返回相同的对等IP地址(74.253.253.31:6757)或错误。

Any ideas why this happens? 任何想法为什么会发生这种情况?

Best regards, TX 德克萨斯州问候

Ok, I think I found the answer to my question: One needs to generate a SHA1 hash from the value of the info key. 好的,我想我找到了我的问题的答案:一个需要从info键的值生成SHA1哈希。 I take all the bytes from d (included, next byte after the word "info") to the last e of the info map (included). 我将所有字节从d (包括,单词“ info”之后的下一个字节)到信息映射的最后e (包括)。

Thus is will be SHA1 of the bold part of the snippet below: 因此,下面的代码段的粗体部分将为SHA1:

...:info d5:filesld6:...[many bytes]...e 9:... (With out the spaces in front of d and after e) ...:信息d5:filesld6:... [许多字节] ... e 9:...(在d之前和e之后没有空格)

Then I simple convert the byte array returned by MessageDigest and insert % for every hex 2 digit pair. 然后,我简单地转换MessageDigest返回的字节数组,并为每个十六进制2位数字对插入%。 Eg: 例如:

%70%47%8F...[snip]...%13%6F%6C %70%47%8F ... [snip] ...%13%6F%6C

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM