Adding label via python RPCClient

General support for problems installing or using Deluge
Post Reply
bengalih
Leecher
Leecher
Posts: 62
Joined: Fri Feb 14, 2014 3:31 am

Adding label via python RPCClient

Post by bengalih »

I looked at this old thread, but couldn't determine an answer:

viewtopic.php?t=53930

I am trying to write a script using the RPCClient methods, e.g:

Code: Select all

    client = DelugeRPCClient('10.10.10.100', 58847, 'user', 'password')
I am able to enumerate 'label' but cannot set the label. What I am trying is:

Code: Select all

                    options = {'label': 'test'}
                    client.core.set_torrent_options(torrent_id, options)
But that doesn't seem to work, and the old RPC docs (the only ones with any info in them) doesn't seem to state it would....

but I am looking for comparable method to use to accomplish this.

thanks
User avatar
ambipro
Moderator
Moderator
Posts: 672
Joined: Thu May 19, 2022 3:33 am
Contact:

Re: Adding label via python RPCClient

Post by ambipro »

Label isn't an option for torrents, it's a separate plugin.

I think you would just use

Code: Select all

client.label.get_labels()

client.label.set_torrent(torrent_id, "label-here")
The parameters may vary, I'm used to the JSON-RPC. I haven't verified these are used in this syntax
bengalih
Leecher
Leecher
Posts: 62
Joined: Fri Feb 14, 2014 3:31 am

Re: Adding label via python RPCClient

Post by bengalih »

the JSON-RPC is the web interface, yes?

The label is an option for the torrents, at least as far as enumeration is concerned, but it appears that you may be right that it can't be set.

That syntax did seem to work. I had tried something similar, but not exact before.

thank you
User avatar
ambipro
Moderator
Moderator
Posts: 672
Joined: Thu May 19, 2022 3:33 am
Contact:

Re: Adding label via python RPCClient

Post by ambipro »

Yes, it will return in the options for the list of torrents, but it is not set or managed directly through the torrent options.
Post Reply