libtorrent is nice but not available on Pypi so it's difficult to install in a virtualenv.
I found 2 alternatives:
- use libtmux to send commands to rtorrent running in a tmux (but the author is searching for a maintainer)
import libtmux
m = 'magnet:?...'
server = libtmux.Server()
session = server.find_where({ "session_name": "rtorrent" })
window = session.attached_window
pane = window.attached_pane
pane.enter()
# suppress_history=False is needed or it will add an invisible character before the magnet link
# and rtorrent won't accept it
pane.send_keys(m.strip(), suppress_history=False)
- use rtorrent's XMLRPC interface (but it needs an nginx or apache configured)
libtorrent is nice but not available on Pypi so it's difficult to install in a virtualenv.
I found 2 alternatives: