首先,这是代码
#!/usr/bin/env python3.4
import libtorrent as lt
import os
fs = lt.file_storage()
lt.add_files(fs, "/var/mirror/packages/") # There are two files in this directory
t = lt.create_torrent(fs, flags = 1&8&16) # 1 = Optimization, 8 = Symbolic links, 16 = calculate file hashes.
t.add_tracker("udp://tracker.[private].com:80")
print(os.path.isdir("/var/mirror/packages/"))
lt.set_piece_hashes(t,"/var/mirror/packages/")
print(t.generate())
这就是我运行它时发生的事情
True
Traceback (most recent call last):
File "./test.py", line 9, in <module>
lt.set_piece_hashes(t,"/var/mirror/packages/")
RuntimeError: No such file or directory
这是我从中得到的页面
我浏览了绑定,但找不到set_piece_hashes
来源。"."
当我将路径更改为or时,它返回相同的错误代码"/"
(保持 add_files 路径相同)
有人知道我在做什么错吗?除了上面链接的网站之外,我找不到任何类型的文档