Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use of unicode breaks this application with cmd prompt #7

Closed
BoomBrush opened this issue Feb 28, 2019 · 6 comments
Closed

Use of unicode breaks this application with cmd prompt #7

BoomBrush opened this issue Feb 28, 2019 · 6 comments
Assignees
Milestone

Comments

@BoomBrush
Copy link

So using this software over command line seems to work fine. However because of the use of unicode in the "torrent list" function:

╔══╦══════════════════════════════════════════╦════╦════════╦════════╦═════════╗
│ST│Name │Hash│DL Speed│UL Speed│ ETA │
╚══╩══════════════════════════════════════════╩════╩════════╩════════╩═════════╝

I am unable to use this function when running the program from C#. It has something to do with cmd prompt's text encoding only being ANSI. I am unable to run this program from within another program with the correct text encoding, otherwise it just returns nothing.

Can you introduce a "-nounicode" tag so that it replaces all the ═'s and ╦'s with characters like - or + so it can be used using external applications that only support ANSI.

@Jorman
Copy link

Jorman commented Apr 2, 2019

I think the same.
Would be very useful have a kind of simplified output, like a plain output, in my case for different purpose, I'm trying to adapt my script to inject tracker list inside the torrent, the actual version is for transmission, and this's exactly what I need, a clean output, so I can awk or sed or whatever it and take the plain result for each torrent I inquire

Can you simplify it?

J

@fedarovich
Copy link
Owner

Well, I had an idea to include different output formats for all commands and even to add the possibility to create custom formats. But I really don't know when I will implement this functionality.

But regarding torrent list command, it already has alternative output mode. If you run it like that:

qbt torrent list --verbose

it will output data in another format. It seems to be more parseable, so maybe it will suit you.

@Jorman
Copy link

Jorman commented Apr 3, 2019

Thanks I'll try to see what I can do with the --verbose option.

In my opinion the best is to have all the list in a table style, so can be quite easy extract all the info, then one command to interrogate each hash torrent but with a possibility to ask only determined information, for example the basic command:
qbt torrent properties 671a60 -> the actual command to see about all data for the selected torrent
can be extended with extra command like

qbt torrent properties seed_time 671a60
qbt torrent properties state 671a60
qbt torrent properties size 671a60

... and so on for all data available.
I don't know if this can make the difference or if is easier to implement to you, is only my point of view :D

What do you think about?

@BoomBrush
Copy link
Author

I tried with the --verbose option, which works by command line but it still doesn't work when coming from C#. I think the issue is because it's rendering yellow text. My suggestion would be when using the --verbose, maybe take away all use of fancy colour.

I think this because when I try running "qbt torrent list -h" I get perfect results. Really, whenever there is no colour and no funny characters I always get the result. As soon as you introduce colour or a ═ it breaks.

If you allowed the --verbose (to remove colour and fancy characters) to work with both "torrent list" AND "torrent properties" that would be really cool.

@fedarovich fedarovich self-assigned this Apr 5, 2019
@fedarovich
Copy link
Owner

fedarovich commented Apr 5, 2019

@BoomBrush, by the way, if you want to get this information in a C# application, it may be easier to use the underlying library, qBittorrent .Net Client, directly. It is available on Nuget nuget

@fedarovich fedarovich added this to the 1.5 milestone Aug 22, 2019
@fedarovich
Copy link
Owner

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants