run external script on torrent stop

Windows specific questions, problems.
Post Reply
abegreen

run external script on torrent stop

Post by abegreen »

I want to execute file renaming/moving script upon torrent completion.

It executes when download finishes, but since torrent is still seeding until seeding goal is reached, script can't rename/move anything.

How can I set it up to run when torrent stops / finishes seeding?

Thanks.
User avatar
Peter
Administrator
Administrator
Posts: 2693
Joined: Wed Jul 07, 2010 6:14 pm

Re: run external script on torrent stop

Post by Peter »

I mean, what you want is basically... use a script to change data files around. BUT, qBittorrent should know what you were doing. Somehow.
This is simply not possible. qBittorrent cannot figure out what the user is doing with their files, it simply does what you tell it to do. Seed X torrent where data is at Y location.

The only way to implement this is by writing your own script that would call qBittorrent Web API to change file location for example. You have to let qBittorrent know somehow.
abegreen

Re: run external script on torrent stop

Post by abegreen »

Hi,

Still looking for a client that could do what all the clients could do 20 years ago.

Screenshot from utorrent 2.2.1

Image

So script runs on every torrent state but the first lines of the script look something like:

if %S=11 do:
delete this
rename that
copy this
move that

...and my script has 4000 lines after this.

Qbit is perfect except for this little thing that makes all the difference to me.

Cheers.
User avatar
Peter
Administrator
Administrator
Posts: 2693
Joined: Wed Jul 07, 2010 6:14 pm

Re: run external script on torrent stop

Post by Peter »

You could always use the qBittorrent API (via Python or else) and code whaaatever you wish. The sky is the limit!
abegreen

Re: run external script on torrent stop

Post by abegreen »

Yes, thank you, it's an answer, it's a solution, it's an idea.

But I just can't figure out what's the point of running a postprocessing script when download finishes.

Torrent is actively seeding until it meets the ratio goal, script can't do sh*t while the files are in use by other program.

It only makes sense to run script when torrent stops.

It should also run after forced recheck, which is the same, when torrent stops.

The solution is to enable automatic assignment of a specific tag to stopped torrents. That way the script can execute, check torrent tags, and chose to proceed or exit.
User avatar
Peter
Administrator
Administrator
Posts: 2693
Joined: Wed Jul 07, 2010 6:14 pm

Re: run external script on torrent stop

Post by Peter »

Well you can most certainly extract a torrent for example, let's say if you download RLS files often, and then you have the extracted files ready. Just one use case.
sam55

Re: run external script on torrent stop

Post by sam55 »

It seems boggling that this is still an issue, but a Google search shows plenty of people struggling with this but no solution.

There seems little point doing anything on completion, as completion seems happily defined as "finished downloading". The people having issues want to run a program at the point where qb has finished with the file altogether, and should have no lock on it.

My solution for now is to run a script to create a text file with the name of the final download item, and the time I expect it to be finished with. I'll then set a seeding time of 11 hours say and I will know that I should be able to do stuff with the file after 12 hours. Means I can't use ratios. Another script will then routinely check the text files and process them. Something like that.

(It might be possible to use the qb log file but the other program is on a different PC and it will get complicated.)

Far easier would be to have a dropdown or a checkbox to delay the program run until after seeding completion.

Sam.
Post Reply