Giter Site home page Giter Site logo

Comments (7)

fedarovich avatar fedarovich commented on June 27, 2024 1

Well, it is possible, though not directly, but with some shell magic.

Basically, you should do the following steps:

  1. Get the list of torrents filtered by category in some parceable format, e.g. JSON.
  2. Extract the torrent hashes from it.
  3. 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.

foxi69 avatar foxi69 commented on June 27, 2024

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.

fedarovich avatar fedarovich commented on June 27, 2024

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.

foxi69 avatar foxi69 commented on June 27, 2024

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.

foxi69 avatar foxi69 commented on June 27, 2024

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.

foxi69 avatar foxi69 commented on June 27, 2024

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.

foxi69 avatar foxi69 commented on June 27, 2024

I have been created my own script with Powershell and works great with your program :)
Thanks @fedarovich

from qbittorrent-cli.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.