2015-09-26 33 views
0

我一直在尝试使用这个python代码http://blog.abhijeetr.com/2011/10/add-trackers-to-torrent-files-in-linux.html来自动将某些公共追踪器添加到torrent文件。BTL.BTFailure:不是有效的合编码字符串

安装BitTorrent-bencode 5.0.8.1并将“bencode.py”-file和“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” -version:github上/ shadyabhi/Bencode- Torrent编辑器

它们都挂在同一点。

到目前为止,我的搜索已经表明,这是由于受损的山洪,无效,我已经尝试成群的不同的所有产生相同的结果,同时与torrenteditor.com评估他们。最后,我不能完全/完全不能解析bencode.py和add_tracker.py的实际代码,就像在这里的不同问题中解释的那样,关于使用相同的脚本,我缺乏python的经验。

如果有人能告诉我,为什么会出现这个问题,什么我可以/应该做些什么来解决这个问题,我会相当gratefull :)

我的布局可能不一致遗憾。

+0

你有一个链接到.torrent文件? – Arvid

回答

-2

是的,这是http://vodo.net/download/torrent/446,并且已经在三个方面得到验证:

  • 在torrentprogram测试它
  • 阅读torrenteditor.com
  • 验证,并在orgininal代码,而这个错误使用写的创作者*

*完整的讨论在这里:http://blog.abhijeetr.com/2011/10/add-trackers-to-torrent-files-in-linux.html

在附注上,我已经通过其他方式获得了我的目标,但是我没有解决这个错误。为了我的理解,也许还有其他人,我仍然很好奇,如果有人能指出错误发生的原因。特别是因为我litteraly复制给定的代码,并遵循程序(据我所知)。