How to check if files are pending download when qBittorrent is NOT running

Other platforms, generic questions.
Post Reply
mostacholoco

How to check if files are pending download when qBittorrent is NOT running

Post by mostacholoco »

Hi there,

This question might sound a bit silly but let me explain myself. I want to create a script that would run each time a login to my PC that would check if there is something pending to be downloaded in qBittorrent and, in case there is, start qBittorrent. This will save me some time and I could really forget about opening qBittorrent.

I've done this for other p2p clients so I thought there might be some way to do it in qBittorrent, as I'm switching to it.

I will need a Linux and Windows script. The script might involve checking for the existance of files, file contents, windows registry (hopefully not!).

Any advice or comment will be well received :)

Thanks in advance.
sledgehammer_999
Administrator
Administrator
Posts: 2443
Joined: Sun Jan 23, 2011 1:17 pm

Re: How to check if files are pending download when qBittorrent is NOT running

Post by sledgehammer_999 »

There isn't any way to do this with a script... Maybe it is totally impossible
You'll probably need to parse qbt conf file + .torrents files + .fastresume files. Not an easy task to do from a script. Especially if you don't know how to write a script.
mostacholoco

Re: How to check if files are pending download when qBittorrent is NOT running

Post by mostacholoco »

Well, in Linux I can use shell script, java, in windows delphi, .batch files, nsis ... it depends on the complexity of the algorithm to use. What I don't know is the algorithm itself. Can you expand a bit on your comment? Thanks.
hex

Re: How to check if files are pending download when qBittorrent is NOT running

Post by hex »

I can imagine several ways to do that:

1) Yo can check the qBittorrent configuration option "Keep incomplete torrents in :"  [Your Download path/temp]
When the download completes, it will move the files from [Your Download path/temp]  to [/Your Download path]
So all you'll need to check in some script is if there are any files in THAT temp directory (you have unfinished download torrents) then starts the program.


2) Simirarly, you could check the option of the extention .!qb for unfinished files, and search for any of them recursively in your downloads folder and subfolders, but is less efficient if you leave your download files in that folder.


3)  You can use both of the options:
* copy .torrent files [DIR1]
and
* copy .torrent files for finished downloads [DIR2]
Then compare both directories with a script.
If there is any .torrent file in the first but not in the last, then you have unfinished downloads.


4) If you want more control or make a log of your downloads, you could do a script/program that saves in a file or some DB when your download completes, and call it in the option:
* Run external program on torrent completion  (%f= torrent path, %n = torrent name)

You can get "when" you started a torrent download with the Date of creation of the .torrent file.


5) The esyest: Always run qbittorrent at windows startup, And configure "Share ratio limiting" so you share X amount, and then remove the torrent;
if there aren't any active torrents (nothing else to download), it does not consumes much RAM nor bandwith.



I hope it helps.
Hex
User avatar
Peter
Administrator
Administrator
Posts: 2702
Joined: Wed Jul 07, 2010 6:14 pm

Re: How to check if files are pending download when qBittorrent is NOT running

Post by Peter »

paxtonleiny wrote: Mon Jun 12, 2023 7:35 am Depending on the complexity of the method, I can use a variety of programming languages and tools under Linux, including shell script, Java, Delphi, batch files, and nsis. The algorithm itself is something I am unfamiliar with. Please elaborate on your remark. Thanks. basketball stars
Well this is some old thread lol.
It'd be super easy to auto-start qBittorrent, use a script to check if there is anything in the state of downloading and then kill it, if there is none.

To check when it's not even started, you'd have to parse all kind of config files, and then go from there.
Post Reply