fedarovich / qbittorrent-cli

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

Adding .magnet Files #11

Closed BzowK closed 5 years ago

BzowK commented 5 years ago

Good Morning -

I found and tried qbittorrent-cli today and love it - thanks or your work! I do have one question/issue, though. I use NZBHydra2 which is hosted on a different system than qBittorrent. In order to grab downloads from it in the past when using Deluge / Deluge-CLI, I've had to configure it to save them to a BlackHole folder then added using deluge-cli.

Each of these files is saved as "downloadname.magnet" which if opened in a text editor only has a single line which is the magnet's URL (magnet:?xt=urn:bt...). I tried adding these using various qbt parameters, but wasn't able to. Attempting to add using "qbt torrent add file downloadname.magnet" resulted in the error "Response status code does not indicate success: 415 (Unsupported Media Type)."

I suppose I could script a workaround, but first wanted to see if there is currently a native way to add these using qbt parameters.

Thank You

fedarovich commented 5 years ago

Hello,

At the moment, the only way to add a torrent using a magnet link is to use the following command:

qbt torrent add url magnet:? ...

So the solution depends on the shell you use. In bash you can use something like that:

qbt torrent add url $(< downloadname.magnet)

I don't remember exactly how do it in powershell, but I suggest it is something like that:

qbt torrent add url (Get-Content downloadname.magnet)
BzowK commented 5 years ago

Understood. Appreciate the reply. Thanks