fedarovich / qbittorrent-cli

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

Request - raw data #13

Closed Jorman closed 5 years ago

Jorman commented 5 years ago

Hi, is possible to have all the data not formatted? I mean not this:

$ qbt torrent list --url http://localhost:8081
╒══╤═══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╤══════╤══════════╤══════════╤═════════╕│ST│Name                                                                                                                       │Hash  │ DL Speed │ UL Speed │   ETA   │╞══╪═══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╪══════╪══════════╪══════════╪═════════╡│SU│Emmerson Nogueira - Beatles                                                                                                │e70b53│    0  B/s│    0  B/s│         │└──┴───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┴──────┴──────────┴──────────┴─────────┘

But this

ST  Name    Hash    DL Speed    UL Speed    ETA
SU  torrentname torrenthash 0 B/s   0 B/s

I want to develop a little script to better handle torrent from qbittorrent and I found qbt that is pretty cool but I can't use the data in this way. So I ask if is possible to use an extra --raw in order to have all data with no particular format, or if this is not possible, maybe a json format? so I still can use jq to better filter all

Thanks for your work, is very cool qbt.

fedarovich commented 5 years ago

Hi, I have a plan to implement such feature. But I have to think how to do it in the best way. I will probably add a --format <FORMAT> option, so it will be possible to specify both screen formats (like Table or List) and raw formats (like CSV, JSON). I'll try to add this feature in the next version (qbt 1.5).

Jorman commented 5 years ago

Thanks!

A little OT, do you know if there's a possibility to change the qbittorrent port or add extra tracker to a specific torrent with cli or live http request?

fedarovich commented 5 years ago

Yes, it should be possible.

Changing of ports can be done by different subcommands of qbt server settings command. For example, to change the incoming connections port, you can use the following command:

qbt server settings connection -p <PORT>

To change web-interface and API port, please use:

qbt server settings web -p <PORT>

To add a tracker to the torrent you can use:

qbt torrent tracker add <HASH> <TRACKER_URL>

In general, all commands are documented in Wiki, though yes, it's not so easy to find the required one.

Jorman commented 5 years ago

Thanks, I don't have searched well!!! My goal is to inject tracker, like this https://github.com/Jorman/Scripts/blob/master/AddTransmissionTrackers.sh only to public torrent, so for this I ask you all this stuff, raw data and so on. So in this way I can call the script from sonarr or radarr, and try to inject tracker to the selected torrent, from a live tracker list, always updated. The port is needed for the PIA VPN, because pia offer a very small windows of time after connection, so I already have script that monitor pia, in this way I can (I hope) make a script that tell to qbittorrent what port have to use

Thanks

fedarovich commented 5 years ago

The output format option is now available in the latest nightly build. I've documented it in the wiki

For example, if you want to have a torrent list in CSV format, you can now use the following:

qbt torrent list --F csv

I will likely make release 1.5 at the end of the week.

Jorman commented 5 years ago

Thank you very much