【发布时间】:2018-08-02 15:42:04
【问题描述】:
我目前正在使用 Python 开发一个 bittorrent 客户端。
我正在尝试从跟踪器获取 the torrent file to download ubuntu 的对等信息。
我已经对 .torrent 文件进行了 B 解码并提取了信息字典并从中创建了一个 SHA1 哈希(完全按照 bittorrent protocol wiki 中的指定)。
我正在使用 python 的 requests 库发送 HTTP Get 请求,但是当我发送请求时,我收到了一个错误。
这是我使用 .torrent 文件中指定的 tracker_url 对 Ubuntu 种子的 Python GET 请求
resp = requests.get('http://torrent.ubuntu.com:6969/announce?info_hash=%3F%19%B1I%F5%3AP%E1O%C0%B7%99%26%A3%91%89n%AB%ABo&peer_id=SAoe4hc3u3du0nepwp1h&compact=1&no_peer_id=0&event=started&port=6883&uploaded=0&downloaded=0&left=1178386432')
作为响应,我得到一个 Response 200,并且 resp.content 是
b'd14:failure reason63:Requested download is not authorized for use with this tracker.e'
我想知道是否有人可以告诉我我的请求有什么问题?非常感谢!
【问题讨论】:
-
不是答案,但您可能想看看这个:markuseliasson.se/article/bittorrent-in-python
-
感谢您的链接!我已经看到了,并且我的代码也以此为基础!我尝试从该帖子中散列 B 编码的信息字典,并且我的 URL 与那个匹配。这就是为什么我对为什么我的代码似乎不起作用感到困惑的部分原因。谢谢!
-
问题是该种子未在跟踪器上列入白名单。它可能已被删除,因为它太旧了。尝试更新的 Ubuntu 种子。
标签: python http python-requests bittorrent