擅长:python、mysql、java
<p>以下是使用libtorrent的代码:</p>
<pre><code>import libtorrent
info = libtorrent.torrent_info('C:\\Torrents\\test.torrent')
n = 0
for f in info.files():
#print (f.path, f.size)
# print "%s - %s" % (f.path, f.size)
n = n + 1
filenamepath = str(f.path)
filesize = str(f.size)
print str(n) + " " + filenamepath + " " + str(filesize)
</code></pre>