Hi,
I'm using the label plugin and I'm writing my own "client" using python.
How can I add a new label to a torrent? Is there a key 'label' or something?
Is there an RPC call to add a label?
-
- New User
- Posts: 3
- Joined: Sat Apr 09, 2016 6:54 pm
Re: Is there an RPC call to add a label?
This is how the Autoadd plugin adds a label: https://github.com/deluge-torrent/delug ... re.py#L290
-
- New User
- Posts: 3
- Joined: Sat Apr 09, 2016 6:54 pm
Re: Is there an RPC call to add a label?
Hi Cas, thanks for your reply. This doesn't help my case however as I'm not writing a plugin. In the meantime I found out that one can get the value of a label as client with get_torrent_status, using 'label' as the key. I cannot find out how to set this value remotely however.
Is there a better place to ask my question?

Is there a better place to ask my question?
-
- New User
- Posts: 3
- Joined: Sat Apr 09, 2016 6:54 pm
Re: Is there an RPC call to add a label?
After searching the forum, the only thing I could find about remotely setting labels that seemed to indicate that it was possible were references to that the WebUI wasn't able to set labels and then cas remarking 'I can't reproduce that'... From that I concluded it has at least be possible. So, I installed deluge-web and managed to indeed set remotely a label. Then I hacked deluge-web until I found out how it did that.
The answer to my own question is therefore:
call,
client.label.set_torrent(torrent_id, label)
this means you have to have the plugin installed locally too;
this line causes an RPC call, sending a base64 encoded JSON
string to the server telling it to execute this remotely.
In other words, apparently the whole remote thing is pretty
much hidden from the user and you can just call stuff as if
it was running locally.
The answer to my own question is therefore:
call,
client.label.set_torrent(torrent_id, label)
this means you have to have the plugin installed locally too;
this line causes an RPC call, sending a base64 encoded JSON
string to the server telling it to execute this remotely.
In other words, apparently the whole remote thing is pretty
much hidden from the user and you can just call stuff as if
it was running locally.
Re: Is there an RPC call to add a label?
Granted it is a slightly different module call between plugin and client the set_torrent method is the same. Looking at the code for the label plugin would have been quicker: https://github.com/deluge-torrent/delug ... enu.py#L62