fedarovich / qbittorrent-cli

Command line interface for QBittorrent
MIT License
303 stars 16 forks source link

Add Torrent and Apply Category #23

Closed smhmd closed 8 months ago

smhmd commented 4 years ago

How to, instead of adding a torrent and setting a category to it using its hash, add a torrent with a category directly? $ qbt torrent add url 'magnet...' && qbt torrent category torrent-hash --set cat to $ qbt -tau 'magnet...' -cs cat.

An Aside: Also, I find the command reference to be a bit difficult to work with (I personally find it FOMO inducing, and miss a traditional man page--top to bottom try this and combine it with this). Shell completions would be very helpful in that regard, as well as examples of commands in the main README (that showcase most to be used commands and long niche ones to familiarize users with the syntax. e.g., how to list all categories' names only or something more complex). I'll gladly open a PR for examples once I know how to do stuff.

fedarovich commented 4 years ago

You can use --category (or simply -c) parameter of the command. The category must already exist. For example,

qbt torrent add url 'magnet...' -c category_name

Yes, I agree that the command reference in far from perfect right now. Actually it is just the output of the command --help converted to markdown. It would be nice if we can enhance it.

I was thinking of autocompletion, but it is not so easy to implement in both bash and powershell, so I postponed it to uncertain time. If you know how to do it - PRs are always welcome :)

smhmd commented 4 years ago

What I'm trying to do: Have xdg-open and dmenu replace qbittorrent's interface. (using mimi, btw.)

 x-scheme-handler/magnet: exec qbt torrent add url <xdg-open puts arg here>

ideally:

x-scheme-handler/magnet: exec qbt torrent add -c $(echo category list to dmenu, choose or add new) url <xdg-open puts arg here>

Challenges: