简体   繁体   English

将HTTP Get发送到Bittorent跟踪器-info_hash和peer_id在哪里?

[英]Sending HTTP Get to Bittorent tracker - Where's info_hash and peer_id?

I'm trying to send a HTTP get request to a tracker. 我正在尝试将HTTP get请求发送到跟踪器。 But I don't know where the info_hash and peer_id are and I need them as parameters. 但是我不知道info_hash和peer_id在哪里,我需要它们作为参数。 According to bittorent specifications the info_hash is the metafile's info "info_hash: urlencoded 20-byte SHA1 hash of the value of the info key from the Metainfo file."and the peer_id "is allowed to be any value" 根据严格的规范,info_hash是图元文件的信息“ info_hash:对来自Metainfo文件的信息密钥的值进行20位字节的SHA1哈希编码。”而peer_id“允许为任何值”

But when I put the properly URL encoded info key as the info_hash, and arbitrarly put something for the peer_id I get this error: d14:failure reason20:Torrent unauthorisede 但是,当我将正确编码的URL信息密钥作为info_hash并任意地为peer_id放入某些内容时,我会收到此错误:d14:failure reason20:Torrent未经授权

Can someone give me an example where the info_hash is in this file? 有人可以给我一个例子,该文件中的info_hash吗?

d8:announce40:http://tracker.the123ay.org/announce13:announce-listll40:http://tracker.th213bay.org/announceel35:udp://tracker.op123rrent.com:80el23:udp://tr123ker.ccc.de:80el29:udp://tracker.pawscbt.com:80el46:udp://tracker.tntvadse.scambioetico.org:2710ee7:comment46:Torrent downloaded from http://theadsde10:created by13:uTorrent/332013:creation datei1391719112e8:encoding5:UTF-84:infod13:file-durationli2462ei2474ee10:file-mediali0ei0ee5:filesld6:lengthi1443259870e4:pathl70:Casdasd7.Problemi.Di.Famiglia.ITA.720p.DLMux.h264-Noasdip.mkveed6:lengthi1461542146e4:pathl70:Chicaasdasx08.Una.Scelta.Difficile.ITA.720p.DLMux.h264-NovaRip.mkveee4:name48:Chicago.Fire.1x07-08.ITA.720p.DLMux.h264-NovaRip12:piece lengthi262144e6:pieces221620:

Using Java if it matters. 如果重要,请使用Java。 Lmk if I need to give more info. LMK,如果我需要提供更多信息。

The info dictionary in your example starts at 您的示例中的信息词典始于

infod13: infod13:

You must determine the info data and calculate the SHA1 of the info data. 您必须确定信息数据并计算信息数据的SHA1。 After that you must to URL encode the SHA1. 之后,您必须对SHA1进行URL编码。

info_hash: urlencoded 20-byte SHA1 hash of the value of the info key from the Metainfo file. info_hash:对Metainfo文件中info键值的值进行20字节SHA1哈希编码。 Note that the value will be a bencoded dictionary, given the definition of the info key above. 请注意,根据上述info键的定义,该值将是本编码的字典。

description 描述

There is an example written in Qt which i think it might help you. 有一个用Qt编写的示例,我认为它可能对您有帮助。 (Qt5.2.1/5.2.1/gcc_64/examples/network/torrent) You can find it online here qt torrent (Qt5.2.1 / 5.2.1 / gcc_64 / examples / network / torrent)您可以在这里在线找到它qt torrent

Edit: Here is a good answer for what you are looking for Calculating the info-hash of a torrent file 编辑:这是您要查找的一个好答案计算torrent文件的信息哈希

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

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