如何使用libtorrent rasterbar python绑定删除已完成的torrent?

如何使用libtorrent rasterbar python绑定删除已完成的torrent?,python,libtorrent,libtorrent-rasterbar,Python,Libtorrent,Libtorrent Rasterbar,我有一个python脚本,它使用libtorrent python绑定下载文件。我只是想知道下载完成后如何删除torrent 我在这里发布了我用来制作我的示例脚本。我没有发布我的示例脚本,因为它太大了,它有数据库部分 import libtorrent as lt import time ses = lt.session() params = { 'save_path': '/home/downloads/'} link = "magnet:?xt=urn:btih:4MR6HU7SIHXAX

我有一个python脚本,它使用libtorrent python绑定下载文件。我只是想知道下载完成后如何删除torrent

我在这里发布了我用来制作我的示例脚本。我没有发布我的示例脚本,因为它太大了,它有数据库部分

import libtorrent as lt
import time

ses = lt.session()
params = { 'save_path': '/home/downloads/'}
link = "magnet:?xt=urn:btih:4MR6HU7SIHXAXQQFXFJTNLTYSREDR5EI&tr=http://tracker.vodo.net:6970/announce"
handle = lt.add_magnet_uri(ses, link, params)

print 'downloading metadata...'
while (not handle.has_metadata()): time.sleep(1)
print 'got metadata, starting torrent download...'
while (handle.status().state != lt.torrent_status.seeding):
    print '%d %% done' % (handle.status().progress*100)
    time.sleep(1)
谢谢

在会话对象上调用remove\u torrent,传入要删除的torrent\u句柄

在脚本中:

卸下手柄