python-libtorrent torrent_info方法

问题描述 投票:0回答:2

我一直在使用

python-libtorrent
来检查哪些片段属于包含多个文件的 torrent 中的一个文件。

我使用下面的代码来迭代 torrent 文件

info = libtorrent.torrent_info('~/.torrent')
for f in info.files():
    print f

但这会返回

<libtorrent.file_entry object at 0x7f0eda4fdcf0>
,我不知道如何从中提取信息。

我不知道

torrent_info
属性会返回各种文件的片值信息。感谢一些帮助。

python python-2.x torrent libtorrent
2个回答
1
投票

API 记录在这里这里。显然,Python API 并不总是与 C++ API 完全相同。但通常该接口采用文件索引并返回该文件的某些属性。


0
投票
info = libtorrent.torrent_info('~/.torrent')
for f in info.files():
    # print f  
    print (f.path) 

您将收到重要消息...

© www.soinside.com 2019 - 2024. All rights reserved.