fedarovich / qbittorrent-cli

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

Hash argument is bugged #102

Closed foxi69 closed 4 months ago

foxi69 commented 4 months ago

qbt torrent list --url $WebURL $Hash Specify --help for a list of available options and commands. Unrecognized command or argument '98d6f7ccbf7e211d43668ea0a2a1cc86c5b1c280'

qbt torrent list --url $WebURL --hash $Hash -> Work

(qbt torrent list --url $WebURL --hash $Hash -F json | ConvertFrom-Json).state Unrecognized option '--hash'

sir-wilhelm commented 4 months ago

What version are you running and on what system?

The first command does not work because it's missing the --hash or -H (as specified in qbt torrent list --help). The second command works, and looks fine.

I can get the 3rd command to work in pwsh on my end, but in your example it's missing the opening (, it should be:

(qbt torrent list --url $WebURL --hash $Hash -F json | ConvertFrom-Json).state
foxi69 commented 4 months ago

qBittorrent CLI v1.8.24012.1 Windows 10 22H2

Fixed opening - still issue, doesnt work in my script, idk why

kép $Trackers = (qbt torrent tracker list --url $WebURL --hash $Hash -F json | ConvertFrom-Json).url

kép Without '--hash'

sir-wilhelm commented 4 months ago

I won't know exactly what is wrong w/o seeing the contents of the script, but the double quoted strings might be the issue.

Does it work correctly if you drop the internal 's? Replacing "' with " and '" with " in all of the -Parameter values?

sir-wilhelm commented 4 months ago

Oh I see the disconnect.

When calling qbt torrent list you need to provide -H or --hash, but it's not required for tracker (see qbt torrent tracker list --help).

$Trackers = (qbt torrent tracker list --url $WebURL $Hash -F json | ConvertFrom-Json).url

if you use that it'll give you an array of all the tracker URLs for the provided torrent/hash.

edit: the error you're getting when you drop the --hash makes me think the extra ' in your hash string are to blame, since they show up around the hash after Unrecognized command or argument.

foxi69 commented 4 months ago

oh I see, it handles separately if hash is an argument and if it can only optionally be used for filtering.

Thanks for the help!