ludviglundgren / qbittorrent-cli Goto Github PK
View Code? Open in Web Editor NEWCli to manage qBittorrent
License: MIT License
Cli to manage qBittorrent
License: MIT License
thanks for quick merge!! i just replaced qbc with qbt
for easy use maybe delete --magnet flag of add command? (can keep for compatibility)
first check if file exists for arg1, if not check if start with magnet: try to add as magnet. very small chance that you add a .torrent file name "magnet:SOMETHING.torrent" so check for file first (qbt hash command has same problem)
Pr welcome?
In my humble opinion, all detailed descriptions of available commands should be removed from the README.md. The information is no longer in sync in the code (e.g. flags for individual commands have been added). It might be sufficient to list all available commands and point out the help flag.
Also, some statements in command descriptions seem to be no longer true, such as for the remove
command:
Removes torrents indicated by hash, name or a prefix of either. Whitespace indicates next prefix unless argument is surrounded by quotes.
As pointed out by a user in #84, using a prefix does not work. Consequently, the descriptions should be checked and updated where required.
@ludviglundgren if you agree I am happy to prepare a PR that reflects my suggestions. On a side note, I have submitted a formula for qbittorrent-cli to Homebrew for the convenience of Mac users such as myself.
I got this error
qbt list
login error: Post "http://127.0.0.1:6776/api/v2/auth/login": dial tcp 127.0.0.1:6776: connect: connection refused
If possible, it would be great if the export function could be filtered with include and exclude tags.
Is there any way to add multiple torrents using the 'add' command?
I've tried a few options including qbt add *.torrent
I am unable to execute this command:
qbt torrent category move --from freeleech --to completed --min-seed-time 10100
the output is
Found 2 matching torrents to move from (freeleech) to (completed)
ERROR: could not pause torrents could not setCategory torrents: [0e19de68217a28d7b9c1911f2b2001c08a1fe3aa 990520868b6b401db82877431bfe0addda837bbb] unexpected status: 409
I can manually pause a single torrent using qbt torrent pause --hashes abc123
Is this a bug or can I do more to troubleshoot on my end?
qbt - qbitttorrent cli
Version: 2.0.0
Commit: f46c1b5edf8ecf1ad181ef05c6742922af07cbd3
Date: 2023-09-24T16:38:19Z
I am running qbittorrent 4.5.5 - is this the issue?
I want to use a remote server as compare-host over https.
Getting the following error when setting https in the toml.
[[compare]]
addr = "https://URL/qbittorrent"
ERROR: connection failed to compare: http: read on closed response body
Edit: with a few hacks, I managed to get https working.
Changed this in client.go
// set basic auth
c.setBasicAuth(req)
resp, err := c.http.Do(req)
if err != nil {
return nil, errors.Wrap(err, "could not make request")
defer resp.Body.Close()
}
return resp, nil
̶ ̶̶̶A̶n̶d̶ ̶s̶e̶t̶ ̶a̶d̶d̶r̶e̶s̶s̶ ̶i̶n̶ ̶t̶h̶e̶ ̶t̶o̶m̶l̶ ̶a̶s̶ ̶h̶t̶t̶p̶s̶:̶/̶/̶f̶o̶o̶:̶p̶a̶s̶s̶w̶o̶r̶d̶@̶x̶x̶x̶.̶d̶e̶d̶i̶.̶h̶o̶s̶t̶i̶n̶g̶b̶y̶.̶d̶e̶s̶i̶g̶n̶/̶q̶b̶i̶t̶t̶o̶r̶r̶e̶n̶t̶
Not how it's suppose to work, but for now I can use https to securely access the remote host.
Trying to do an import from rtorrent to qbt:
$ ./qbt import --source rtorrent --source-dir ~/rtorrent/session --qbit-dir ~/.local/share/qBittorrent/BT_backup --dry-run
Prepare to backup torrent data before import..
Creating rtorrent backup of directory: /home/user/rtorrent/session to /home/user/qbt_backup/rtorrent_backup_20230410104453.tar.gz ...
could not backup directory: "walking /home/user/rtorrent/session: /home/user/rtorrent/session/rpc.socket: writing: session/rpc.socket: making header: archive/tar: sockets not supported"
Error: walking /home/user/rtorrent/session: /home/user/rtorrent/session/rpc.socket: writing: session/rpc.socket: making header: archive/tar: sockets not supported
Usage:
qbt import [flags]
Flags:
--dry-run Run without doing anything
-h, --help help for import
--qbit-dir string qbit dir (required)
--skip-backup Skip backup before import. Not advised
--source string source client [deluge, rtorrent] (required)
--source-dir string source client state dir (required)
Global Flags:
--config string config file (default is $HOME/.config/qbt/.qbt.toml)
Seems to work fine with --skip-backup
First of all thank you for this tool!
While trying to use the 'move' option I get a successful message but categories remain unchanged. I don't see any pertinent info in qbit logs other than a successful web login.
However when manually changing a torrents category in web-ui there is related info in the log. Let me know if I can provide more info.
Edit: Looks to may be a 4.5.x issue - move works as intended on 4.3.9
qbittorrent version: qbittorrent-nox v4.5.2 on debian
qbt-cli version: tried dev / 1.0.0 / 0.16.0
qbt move --from t1 --to t2
Found 1 matching torrents to move from (t1) to (t2)
Successfully moved 1 torrents from (t1) to (t2)
The reannounce command states that it reannounces torrents with non-OK tracker status. Does this mean that it automatically searches for torrents with trackers that have a "not working" status? Or does it need to somehow be fed the hashes of torrents with a non-working tracker?
So im trying to add a new torrent with a custom save path.
The idea is to make a script to generate my custom download paths, issue is i can't seem to figure out how to pass in a save path argument.
i peeded the add torrent code and can see there is a reference to save-path but unsure how to use it?
command: qbt torrent add url "URL HERE" --save-path "/PATH/HERE"
am i doing something wrong / is there support for this?
Thanks so much for this code, the import especially!
I've noticed that no matter what the hash specified (even if non-existent), it reports "successfully" resumed or removed.
qbt torrent remove --delete-files --hashes 111
(1) torrents to be removed
successfully removed (1) torrents
torrent(s) successfully deleted
qbt torrent resume --hashes zzzzzzz
torrent(s) successfully resumed
Import torrents with state from Deluge and rTorrent
is it possible to import torrents with stats from another qbittorrent instance?
Hi! Thanks for this amazing CLI.
I'm trying to package this for AlpineLinux, but the project currently has no license attached.
Can you add a OSS compatible license to your project?
To me, it seems like the only way to tell if you are doing a dry run vs an actual run is just examining the amount of time it takes. I think there should be some kind of indication that it is indeed a dry run
For example:
Dry run: Import finished in: 306.529729ms
Actual run: Import finished in: 1.368155058s
This program is fantastic btw, it worked great for me for migrating from rtorrent 0.9.8 to qbittorrent-nox 4.5.2
qbt
chokes on filepaths that contain square brackets (e.g. some linux iso [123].torrent
) because it treats input as a glob pattern.
Could qbt
check if filePath
is actually the path of a .torrent
file before it tries to use it as a globbing pattern?
login error: Post "http://127.0.0.1:6776/api/v2/auth/login": dial tcp 127.0.0.1:6776: connect: connection refused
how do I solve it?
this below is the command line I am trying to input ./qbt add --magnet magnet:?xt=urn:btih:6429b3fe8614b55b429bc2eb023e1553118ec2f2&dn=Samaritano%202022%201080p%20WEB-DL%20DUAL%205.1&tr=udp%3a%2f%2ftracker.openbittorrent.com%3a80%2fannounce&tr=udp%3a%2f%2ftracker.opentrackr.org%3a1337%2fannounce
In a completely surprising move, any and all output of qbt breaks when it's piped into a pager like less or redirected into a file.
The resulting stream is missing all newlines. This of course also breaks grepping from output and the like.
I need to be able to add torrents to an instance of qBittorrent WebUI that is set to work through https.
I could not find such a setting. The setting for 'host' takes domain or IP (not URL), then tries to connect over http.
Is there a configuration option that I missed? or is it possible to add the option?
Thanks.
Been testing the b1 build, only issue I found until now is that the update command doesn't work.
linux-and64 build.
Error: unknown command "update" for "qbt"
Run 'qbt --help' for usage.
Another blocker on my packaging process.
$ go test ./...
# github.com/ludviglundgren/qbittorrent-cli/cmd [github.com/ludviglundgren/qbittorrent-cli/cmd.test]
cmd/export_test.go:30:99: too many arguments in call to processHashes
have (string, string, map[string]struct{}, []string, bool)
want (string, string, map[string]struct{}, bool)
FAIL github.com/ludviglundgren/qbittorrent-cli/cmd [build failed]
? github.com/ludviglundgren/qbittorrent-cli/cmd/qbt [no test files]
? github.com/ludviglundgren/qbittorrent-cli/internal/config [no test files]
? github.com/ludviglundgren/qbittorrent-cli/internal/domain [no test files]
? github.com/ludviglundgren/qbittorrent-cli/internal/fs [no test files]
? github.com/ludviglundgren/qbittorrent-cli/pkg/qbittorrent [no test files]
? github.com/ludviglundgren/qbittorrent-cli/pkg/torrent [no test files]
2023/03/12 15:43:12 Total torrents to process: 2
2023/03/12 15:43:12 os create error: open ../../test/output/deluge/3eced34cd948e7ea92f31ded3e0fd734274fee4a.fastresume: no such file or directory
2023/03/12 15:43:12 Could not create qBittorrent fastresume file ../../test/output/deluge/3eced34cd948e7ea92f31ded3e0fd734274fee4a.fastresume error: "open ../../test/output/deluge/3eced34cd948e7ea92f31ded3e0fd734274fee4a.fastresume: no such file or directory"
--- FAIL: TestDelugeImport_Import (0.00s)
--- FAIL: TestDelugeImport_Import/import_from_deluge (0.00s)
deluge_test.go:25: Import() error = open ../../test/output/deluge/3eced34cd948e7ea92f31ded3e0fd734274fee4a.fastresume: no such file or directory, wantErr false
--- FAIL: TestRTorrentImport_Import (0.00s)
--- FAIL: TestRTorrentImport_Import/import_from_rtorrent (0.00s)
rtorrent_test.go:27: Import() error = Directory does not exist: ../../test/import/sessions/: stat ../../test/import/sessions/: no such file or directory, wantErr false
FAIL
FAIL github.com/ludviglundgren/qbittorrent-cli/internal/importer 0.005s
FAIL
I bumped into this issue today, not thinking it would be an issue having a trailing slash or not.
I had the following.
qbt import --source rtorrent --source-dir '/rtorrent/session' --qbit-dir '/qBittorrent/BT_backup' --dry-run
Which just got me Total torrents to process: 0
, couldn't figure out what was going on, done a google and come across this reddit comment about it, turns out both source and dest need a trailing slash.
This then worked.
qbt import --source rtorrent --source-dir '/rtorrent/session/' --qbit-dir '/qBittorrent/BT_backup/' --dry-run
Another user having the same issue: https://www.reddit.com/r/seedboxes/comments/pidhbd/comment/hbphs8f/?utm_source=share&utm_medium=web2x&context=3
Think it would be helpful to other users if you could leave a note in the documentation, or add the trailing slash in code if it's missing.
PS, this is meant to be constructive feedback, I really like what you have made, thank you!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.