torf-cli icon indicating copy to clipboard operation
torf-cli copied to clipboard

Feature requests.

Open kdantas opened this issue 4 years ago • 4 comments

Hi @rndusr, is it possible include the options:

--nopublisher --nopublisher-url

Some trackers include these informations, but is not necessary. Torrent info

kdantas avatar Oct 13 '21 02:10 kdantas

We also need --publisher and --publisher-url. Otherwise --nopublisher and --nopublisher-url have no effect.

rndusr avatar Oct 13 '21 07:10 rndusr

We also need --publisher and --publisher-url. Otherwise --nopublisher and --nopublisher-url have no effect.

Ok, but are you able to implement these command options?

kdantas avatar Oct 13 '21 18:10 kdantas

Yes, when I find the time.

rndusr avatar Oct 13 '21 19:10 rndusr

Yes, when I find the time.

Of course, in your time. I just have to thank you for all your help.

kdantas avatar Oct 14 '21 23:10 kdantas

Actually, it would be much better to have CLI arguments to insert/remove arbitrary values. Something like:

torf -i foo.torrent --insert :publisher:me bar.torrent
torf -i bar.torrent --remove publisher baz.torrent

The first character in :publisher:me is the delimiter between key and value.

This doesn't allow for to editing nested dictionaries and lists. There should be inspiration in man jq?

A much easier and more straightforward approach would to use JSON:

torf -i foo.torrent --insert '{"info": {"metadata": {"publisher": "me"}}}' bar.torrent
torf -i foo.torrent --remove .info.metadata.publisher bar.torrent

rndusr avatar Apr 12 '23 13:04 rndusr

The latest release has a --merge option that allows you to add or remove arbitrary data:

$ torf path/to/content --merge '{"custom": {"publisher": "Someone"}}'
[...]
$ torf -vmi content.torrent
{
    [...]
    "custom": {
        "publisher": "Someone"
    },
    [...]
}
$ torf -i content.torrent --merge '{"custom": {"publisher": "Someone Else"}}' -o foo.torrent
[...]
$ torf -vmi foo.torrent
{
    [...]
    "custom": {
        "publisher": "Someone Else"
    },
    [...]
}

rndusr avatar Mar 25 '24 11:03 rndusr