Comments (7)
Well, it is possible, though not directly, but with some shell magic.
Basically, you should do the following steps:
- Get the list of torrents filtered by category in some parceable format, e.g. JSON.
- Extract the torrent hashes from it.
- Pass the hashes to
qbt torrent pause
one by one.
For powershell
you can use something like that:
(qbt torrent list -c MyCategory -F json | ConvertFrom-Json).hash | foreach { qbt torrent resume $_ }
In bash
it is easier to use CSV format as you can use awk
to extract the hash. You can use the following script:
qbt torrent list -c MyCategory -F csv | awk -F "," 'NR > 1 {print $1}' | xargs -n 1 qbt torrent pause
I will probably add some additional output formats in the next qbt
versions to make similar scenarios easier.
from qbittorrent-cli.
Oh thanks.
Can u help me how can i make a script what pause the torrent and unrar after downloaded + delete the rar files after unrar complete :|
Like this one:
cmd /c timeout /t 15 & "E:\Programok\WinRAR\RAR.exe" x -r "%F*.rar" "%F" && del /f "%F*.r'[0-9]{2}'" && del /f "%F*.sfv*"
but i dont know how to open powershell in the background to pause first :/
from qbittorrent-cli.
In order to run a command in powershell you can use the following:
powershell -Command "<command>"
So, if I correctly understand what you'd like to achieve, you can use something like that:
powershell -Command "(qbt torrent list -c MyCategory -F json | ConvertFrom-Json).hash | foreach { qbt torrent resume $_ }" && cmd /c timeout /t 15 & "E:\Programok\WinRAR\RAR.exe" x -r "%F*.rar" "%F" && del /f "%F*.r'[0-9]{2}'" && del /f "%F*.sfv*"
from qbittorrent-cli.
Works with a batch file what i run from qBitorrent :)
\RUN.bat "%I" "%F"
powershell -Command "(qbt torrent list --url http://localhost:8080 -c MyCategory -F json | ConvertFrom-Json).hash | foreach { qbt torrent pause $_ --url http://localhost:8080 }" && cmd /c timeout /t 15 & "E:\Programok\WinRAR\RAR.exe" x -r "%2*.rar" "%2" && del /f "%2*.r*" && del /f "%2*.sfv*"
from qbittorrent-cli.
I wanted to pause the torrent what downloaded already, but with this code it will stop every torrent in the specified category after one torrent downloaded in that category :/
from qbittorrent-cli.
After it unrar the torrent, how can i delete only the rar,r01....r99 files? :)
powershell Get-ChildItem $Path | Where{$_.Name -Match "*.r[0-9]{2}"} | Remove-Item
it doesnt work :(
from qbittorrent-cli.
I have been created my own script with Powershell and works great with your program :)
Thanks @fedarovich
from qbittorrent-cli.
Related Issues (20)
- Ubuntu install issue HOT 2
- Logging timestamps are all 1970 (Unix epoch year) but some time in January HOT 2
- Modified time stamp changed after loading from qbittorent HOT 1
- How to list status of a single torrent ? HOT 2
- rename rss feeds
- torrent list filter return Sequence contains more than one matching element HOT 1
- add exit command HOT 1
- Ability to redirect stdout [Feature Request] HOT 1
- Detected virus during scan job HOT 4
- Add export torrent command
- Feature request: plain text output format HOT 2
- Add all time upload and downloads stats to qbt global info HOT 2
- Support for Debian 12 HOT 2
- Cannot find property HOT 2
- FreeBSD support? HOT 1
- Tags question
- How I prefer to view the output of 'gbt torrent list'
- RSS rule's save path editing doesn't work on qBittorrent 4.6
- Stopped working says key not valid HOT 1
- Filename is incorrectly interpreted as glob pattern HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from qbittorrent-cli.