【发布时间】:2015-09-26 23:21:53
【问题描述】:
我一直在尝试使用此 python 代码 http://blog.abhijeetr.com/2011/10/add-trackers-to-torrent-files-in-linux.html 自动将某些公共跟踪器添加到 torrent 文件中。
安装 BitTorrent-bencode 5.0.8.1 并将“bencode.py”文件和“BTL.py”复制到包含我的“add_tracker.py”、“trackers.txt”和“Spaceman.2009”的文件夹中。 Xvid-VODO.mp4.torrent”,我得到错误:
Microsoft Windows [Version 10.0.10240]
(c) 2015 Microsoft Corporation. All rights reserved.
C:\Users\a>cd C:\Users\a\Documents\python\lol
C:\Users\a\Documents\python\lol>add_tracker.py trackers.txt Spaceman.2009.Xvid-VODO.mp4.torrent
Traceback (most recent call last):
File "C:\Users\a\Documents\python\lol\add_tracker.py", line 22, in <module>
decoded_data = bencode.bdecode(torrent_file.read())
File "C:\Users\a\Documents\python\lol\bencode.py", line 68, in bdecode
raise BTFailure("not a valid bencoded string")
BTL.BTFailure: not a valid bencoded string
C:\Users\a\Documents\python\lol>
另外,我还尝试了旧的“bencode.py”版本,最初的帖子位于:github /shadyabhi/Bencode-Torrent-Editor
它们都挂在同一点上。
到目前为止,我的搜索表明这是由于损坏的 torrent 造成的,以证明我已经尝试了成群的不同的 torrent,都产生了相同的结果,同时使用 torrenteditor.com 评估它们。
除此之外,我不能完全/完全不能剖析 bencode.py 和 add_tracker.py 的实际代码,正如这里不同问题中所解释的,关于使用相同的脚本,因为我缺乏python经验。
如果有人能告诉我为什么会出现这个问题,以及我可以/应该做些什么来解决它,我将不胜感激:)
对于可能不一致的布局,我很抱歉。
【问题讨论】:
-
你有那个 .torrent 文件的链接吗?
标签: python-2.7 bittorrent tracker