rtorrent-python icon indicating copy to clipboard operation
rtorrent-python copied to clipboard

Initialization fails because of missing d.multicall method

Open blacklight opened this issue 5 years ago • 0 comments

Environment: Arch Linux, latest packages version, rtorrent 0.9.8.

>>> import rtorrent as rt
>>> client = rtorrent.RTorrent('http://localhost:5000/RPC2')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.8/site-packages/rtorrent/__init__.py", line 71, in __init__
    self.get_torrents()
  File "/usr/lib/python3.8/site-packages/rtorrent/__init__.py", line 127, in get_torrents
    m.add("d.multicall", view, "d.get_hash=",
  File "/usr/lib/python3.8/site-packages/rtorrent/rpc/__init__.py", line 130, in add
    _handle_unavailable_rpc_method(method, self.rt_obj)
  File "/usr/lib/python3.8/site-packages/rtorrent/rpc/__init__.py", line 48, in _handle_unavailable_rpc_method
    raise MethodError(msg)
rtorrent.err.MethodError: Method isn't available.

d.multicall is indeed not available on this version of rtorrent, and it's instead replaced by either d.multicall2 or d.multicall.filtered:

xmlrpc localhost:5000 system.listMethods
...
  Index 142 String: 'd.multicall.filtered'
  Index 143 String: 'd.multicall2'
...

Any idea of how to fix it? (I guess that a proper fix should evaluate whether the server provides d.multicall or d.multicall2 and call the appropriate method).

blacklight avatar Sep 02 '20 17:09 blacklight