时间戳转换器

解码 Torrent 跟踪器抓取的 Torrent Hash?

日期:2023-02-23     浏览:256    
【中文标题】解码 Torrent 跟踪器抓取的 Torrent Hash?【英文标题】:Decode Torrent Hash of Torrent tracker scrape? 【发布时间】:2014-05-26 09:27:32 【问题描述】:

我正在使用 BEncoded PHP Library 解码来自 Bittorrent 跟踪器的编码响应。

Tracker 的响应是:

d5:filesd20:¼€™rÄ2ÞÊþVA  .]á^¦d8:completei285e10:downloadedi22911e10:incompletei9eeee

使用以下代码解码后:

require 'bencoded.php';

$be = new BEncoded;
//Response saved in scrape.txt
$data =file_get_contents('scrape.txt');
print_r($be->Decode($data));

输出是:

Array ( [files] => Array ( [¼€™rÄ2ÞÊþVA  .]á^¦] => Array ( [complete] => 285 [downloaded] => 22911 [incomplete] => 9 [isDct] => 1 ) [isDct] => 1 ) [isDct] => 1 )

我的问题 我在上述输出中的问题是如何解码输出中的那些神秘字母。

【问题讨论】:

这里可以直接看到tracker的回复exodus.desync.com:6969/scrape/… 【参考方案1】:

user3690414 发布的链接:http://wiki.vuze.com/w/Scrape 几乎解释了不同键的含义。

解释原始的编码字符串:

d5:filesd20:¼€™rÄ2ÞÊþVA  .]á^¦d8:completei285e10:downloadedi22911e10:incompletei9eeee

您需要了解 Bencoding 的工作原理:https://wiki.theory.org/BitTorrentSpecification#Bencoding

这里最重要的是要知道,编码字典中的每个条目都是 Key,Value-pair。 其中 Key 是 字节字符串 和 Value 以下类型之一:byte string、integer、list 或 dictionary。

考虑到这一点,原始字符串可以这样分解:

d               // The first d indicates the start of the Root dictionary
 5:files            // that has a Key with a 5 byte string name 'files',
  d                     // the value of the 'files'-key is a second dictionary
   20:¼€™rÄ2ÞÊþVA  .]á^¦    // that has a Key 20 byte = 160 bit big endian SHA1 info-hash
    d                       // the value of that key is a third dictionary
     8:complete                 // that has a Key with a 8 byte string name 'complete',
      i285e                         // the value of that key is a Integer=285
     10:downloaded              // that has a Key with a 10 byte string name 'downloaded',
      i22911e                       // the value of that key is a Integer=22911
     10:incomplete              // that has a Key with a 10 byte string name 'incomplete',
      i9e                           // the value of that key is a Integer=9
    e                       // this e indicates the end of the third dictionary
  e                     // this e indicates the end of the second dictionary
e               // this e indicates the end of the Root dictionary

希望这有助于理解“bencoded.php”的输出。

编辑。 如果您想制作 160 位大端 SHA1 信息哈希 [¼€™rÄ2ÞÊþVA .]á^¦] 更易于阅读,我建议您将其输出为 40 字节的十六进制编码字符串:0xBC801B9D9972C432DECAFE56410F092E5DE15EA6

【讨论】:

所以必须将其转换为 40 字节的十六进制编码字符串才能使其可读,对吧?【参考方案2】:

如果您指的是 files 数组的损坏键,那么它是原始的 infohash - 查看规范:

https://wiki.theory.org/BitTorrentSpecification#Tracker_.27scrape.27_Convention http://wiki.vuze.com/w/Scrape

【讨论】:

但是如何正确显示呢? @Proger_XP

相关文章

如何检查 .torrent 文件?

{...容$od-cxyz.torrent文件的某些内容是纯文本形式,例如有关跟踪器、创建日期、使用的编码、长度和片段数的信息,但其余部分是编码的。有人可以告诉我如何检查种子文件,以便我可以解码所有内容。【问题讨论】:【参考方案1...}

如何解码经过编码的 torrent 数据

{】如何解码经过编码的torrent数据【英文标题】:Howtodecodebencodedtorrentdata【发布时间】:2015-05-2513:01:04【问题描述】:我正在尝试从torrent文件中提取大小和名称,并使用bencode解码torrent文件的内容。我做了pipinstallbencode然后我用你...}

为啥我对 torrent 跟踪器的 GET 请求不起作用?

{】为啥我对torrent跟踪器的GET请求不起作用?【英文标题】:WhymyGETrequesttoatorrenttrackerdoesn\'twork?为什么我对torrent跟踪器的GET请求不起作用?【发布时间】:2016-10-1211:36:31【问题描述】:我绝对是Bittorrent协议的新手,我试图向跟踪...}

在 node.js 中查询 torrent 跟踪器

{】在node.js中查询torrent跟踪器【英文标题】:Querytoatorrenttrackerinnode.js【发布时间】:2013-05-2609:33:05【问题描述】:我正在寻找一个node.js实现来查询torrent跟踪器(http、udp或其他)以获取种子、对等点和下载我发现的只是一个跟踪...}

我无法从公共跟踪器 libtorrent 下载 torrent

{】我无法从公共跟踪器libtorrent下载torrent【英文标题】:Ican\'tdownloadtorrentfrompublictrackerlibtorrent【发布时间】:2015-06-2316:36:41【问题描述】:我在python中使用libtorrent模块来下载种子。我可以从私人跟踪器下载种子,但不能从公共...}

在 python 中对 torrent 跟踪器的 HTTP 请求

{】在python中对torrent跟踪器的HTTP请求【英文标题】:HTTPrequesttothetorrenttrackerinpython【发布时间】:2017-06-2813:19:20【问题描述】:我想写一个pythontorrent客户端(因为我需要它并且我想提高我的技能)。我必须向跟踪器发送HTTP获取请...}

C# 使用 MonoTorrent 下载 torrent

{...看wireshark中的网络流量时,客户端似乎甚至没有尝试联系跟踪器。它可以正确读取torrent文件,并且VisualStudio没有显示错误。这是我正在使用的代码:publicFo}

Torrent 握手响应大于 68 字节

{...bittorrent协议创建自己的Torrent客户端。我目前处于可以从跟踪器获取对等列表并获取对等的IP和端口的阶段。问题在我向对等方发送握手消息后开始。我按照说明发送了一个68字节的握手消息,其中包含哈希、客户端ID等。我}

在活动网站中检索外部 torrent 统计信息的最佳方式

{...:我正在制作一个类似于ThePirateBay、Kickass.to等的bittorrent跟踪器/网站。有必要在索引和torrent页面中检索torrent统计信息(种子、下载)。示例:ht}

Torrent Tracker 信息哈希 GET 请求 - Python

{...012-11-2801:46:38【问题描述】:我正在尝试连接到一个torrent跟踪器以接收一个可以与之一起玩比特torrent的对等方列表,但是我在形成正确的GET请求时遇到了麻烦。据我了解,我必须从.torrent文件中获取经过编码的“信息”部分的20...}

Copyright ©2021 时间戳转换器 小常识 114pp | 陕ICP备18005036号