KoSel
KoSel

Reputation: 23

Python – rTorrent - XMLRPC library – get tracker url

I am using „XMLRPC library“ to get info from rTorrent server.

server = xmlrpc.client.Server(server_url) 
name=server.get_name()
tracker = server.t.get_url(torrent,0)

This works fine. I get name and first tracker url.

But, how to get tracker name by using multicall2?

This works:

print(server.d.multicall2("", "main","d.hash=", "d.get_name=", "d.get_size_bytes=","d.get_ratio=","d.state="))

It show all torerent like

['717BD92A209D56B3E89422B903BAC209E1114C55', 'Mastering_Visual_Studio_2019,_2nd_Edition_by_Kunal_Chowdhury.epub', 12115165, 0, 1]

When I add "t.get_url=" param to multicall2

print(server.d.multicall2("", "main","d.hash=", "d.get_name=", "d.get_size_bytes=","d.get_ratio=","d.state=", "t.get_url="))

I got

xmlrpc.client.Fault: <Fault -503: 'Target of wrong type to command.'

When I add " "t.multicall=" param to multicall2

I got this result

['717BD92A209D56B3E89422B903BAC209E1114C55', 'Mastering_Visual_Studio_2019,_2nd_Edition_by_Kunal_Chowdhury.epub', 12115165, 0, 1, [[]]]

How to pass t.get_url param to "t.multicall=" inside multicall2?

Is there another way to obtain this information?

Upvotes: 2

Views: 1008

Answers (2)

SidewaysUpJoe
SidewaysUpJoe

Reputation: 21

The t.get_url command has been renamed to t.url (along with other commands).

https://github.com/rakshasa/rtorrent/wiki/rTorrent-0.9-Comprehensive-Command-list-(WIP)

Upvotes: 2

dippynark
dippynark

Reputation: 3003

The following works for me:

torrents = server.d.multicall2("",
  "main",
  "t.multicall=,\"\",\"t.url=\"")

for torrent in torrents:
  print(torrent[0][0][1])

Potentially you'll need to use t.get_url? I haven't got that command, I'm using a library corresponding to these docs.

Upvotes: 1

Related Questions