【发布时间】:2017-05-23 11:52:23
【问题描述】:
我正在尝试使用 libtorrent 将一些种子文件转换为磁铁。
我读过你可以在 python 中使用
info = libtorrent.torrent_info(sys.argv[1])
print "magnet:?xt=urn:btih:%s&dn=%s" % (info.info_hash(), info.name())
我在 C++ 上尝试过以下方法
torrent_info ti(current_file.c_str(), ec);
printf("magnet:?xt=urn:btih:%s&dn=%s\n", ti.info_hash().to_string().c_str(), ti.name().c_str());
但结果不是正确的字符串(是二进制),不能使用结果。
有人知道如何将种子的哈希值转换为我可以打印的东西吗?
非常感谢。
【问题讨论】:
标签: c++ torrent libtorrent