Torrent Search

forum.utorrent.com

µTorrent Community

You are not logged in.

#1 2006-04-17 14:34:40

cecolon
Member

Run external program on events (global!)

Hi! Thanks for this program, really neat and tiny smile I have a suggestion though, that I think can be really useful.

I have seen other requests for abillity to run a program when a download starts, finishes, is removed, is moved, etc.. All that would be nice, but if that is too much to implement, what about running just one program with a parameter specifying the event and then the necessary data? Then users would be able to create for instance batch-files that does whatever they want.

Example: When a download is finished, run <program> finished "<file/directory>". When a download is started, run <program> started "<file/directory>", and so on


In any case; I really hope that a feature that makes us able to specify a program that will run when any download finishes (i.e. globally) will be soon implemented. For my part, I would make batch-files or programs that does the following:

1. If the download is a set of one or more .rar-files, it should extract them
2. If it was a rar-file, move the file to a "finished"-directory
3. If not, create a shortcut in the "finished"-directory
4. Send a message to a remote computer (e.g. by net send) and tell which download that is completed

The idea behind this is that I can delete the extracted file or shortcut after watching the episode or whatever, but still seed.

Offline

#2 2006-04-17 14:40:22

cecolon
Member

Re: Run external program on events (global!)

Just adding, this feature would incorporate a lot of the other requests in this forum, e.g. moving a file when finished, unraring, notifying a user, setting read-only flag and so on. Developers: Please tell the status of this feature smile

Offline

#3 2006-04-18 12:39:56

dz006
Member

Re: Run external program on events (global!)

I would also like to see this feature. There is an option to run a command line program individually for each torrent but I do most of my torrent stuff via RSS, thus I want to use the command line program BLAT to email me each time an RSS automated download has completed.

Cheers.

Offline

#4 2006-04-18 12:42:30

dz006
Member

Re: Run external program on events (global!)

In fact this is something that would actually prompt me to donate to uTorrent. I have just switched from Azureus because Azureus just wasn't very "clean" and seemed very very "heavy" but it did all email notifications. I think that uTorrent should be kept "lite" so no need to build in special email functions but the ability to globally (or at RSS favourites level) be able to assign a command line program to run would be fantastic.

Offline

#5 2006-04-18 13:10:45

cecolon
Member

Re: Run external program on events (global!)

I got another idea - I wrote a little batch-program that checks any directory if there are any new files, if there are, check various things like if they are directories or files, and if they conatain/are rar-files. Then do the appropriate action, like copy or unrar. This runs every 1 minute by Scheduled tasks, and can of course be run in any directory. Maybe you should donate to me instead wink

Edit: And of course it does a net send after unraring/copying smile

Last edited by cecolon (2006-04-18 13:12:22)

Offline

#6 2006-04-18 23:13:22

dz006
Member

Re: Run external program on events (global!)

Yeah but how do you check that the torrent has finished? As soon as a torrent starts downloading it creates the destinaiton files ready to be "filled" with data.

Offline

#7 2006-04-19 02:28:40

Vectorferret
Member

Re: Run external program on events (global!)

a) Use a different directory for files that are currently downloading.
b) Use the ut! extension option and ignore those from file completed check

Global commands / pre-set commandlines for RSS feeds has been asked before; but I do not believe that it was rejected.

Offline

#8 2006-04-19 04:09:55

dz006
Member

Re: Run external program on events (global!)

Brilliant - thanks

Offline

#9 2006-04-19 04:30:12

cecolon
Member

Re: Run external program on events (global!)

Yup, I use Vectorferrets alternative a. It seems to work smoothly so far, but I haven't tested it for more than one day (and I haven't downloaded anything yet!)

Offline

#10 2006-04-19 22:10:25

-pk-
Member

Re: Run external program on events (global!)

b would not work with multi-part downloads because the .ut! extention is removed when the download completes each file seperately.

Offline

#11 2006-04-21 13:05:25

cecolon
Member

Re: Run external program on events (global!)

OK, here is my quick and dirty solution. If you want to understand it, I suggest you start by reading scan.bat (the other files are called from that one).

The following files are added to a directory called DownloadWatch. That directory should be placed in the directory µTorrent copies new downloads to.

action.bat

set outdir="E:\Finished"
dir /b %1 > checkrar.txt
find ".rar" checkrar.txt > nul

goto :%2

:dir
if %ERRORLEVEL%==1 goto dircopy
mkdir %outdir%\x\%1
for %%i IN (%1\*.rar) DO unrar x -o- %%i %outdir%\x\%1
goto end
:dircopy
xcopy /I /Y /E %1 %outdir%\x\%1
goto end

:file
if %ERRORLEVEL%==1 goto filecopy
unrar x %1 %outdir%\%1
goto end
:filecopy
xcopy /Y %1 %outdir%

:end
netsend remote_computer %1
echo %1 finished >> log.txt

checknew.bat

if %1=="..\DownloadWatch" goto end
find %1 dirold.txt > nul
if %ERRORLEVEL%==0 goto end
call action.bat %1 %2
:end

scan.bat

mode con codepage select=865

for %%i IN (..\*.*) DO call checknew.bat "%%i" file
for /D %%i IN (..\*.*) DO call checknew.bat "%%i" dir

del dirold.txt
for %%i IN (..\*.*) DO echo %%i >> dirold.txt
for /D %%i IN (..\*.*) DO echo %%i >> dirold.txt

Scan.bat is called by a scheduled task every minute. You could also make another batch file that loops it every so often.

Notes:
- You should replace the codepage with one that supports characters your files probably will use (i got problems with norwegian characters using the default one)
- I use a third-party netsend program, because Microsoft's one was unstable. Google for it, or use net send.
- action.bat can do whatever you like with these files or directories. My action.bat checks if the file is a rar file or the directory contains one, and then unrars it to another folder. If not, it copies the file to the same folder. Then it sends a message to my computer with the file name.
- You need unrar (from WinRAR) in the same directory (or just use the absolute path)

Last edited by cecolon (2006-04-21 13:08:35)

Offline

#12 2006-04-24 11:38:19

cecolon
Member

Re: Run external program on events (global!)

Did anyone try this solution? Please tell if it worked for you smile

Offline

#13 2006-11-20 16:29:21

dossa
Member

Re: Run external program on events (global!)

I tried the script, but i have one problem.

I want the script to start uploading the finished files, but i have a small problem (i'm not that good with batch programming)

In action.bat :
-----------------
:end
C:\Programfiler\FlashFXP\FlashFXP.exe -upload SITE -localpath="D:\Download\Ferdig\%1" -remotepath="/UPLOAD/%1"
echo %1 finished >> log.txt
---

But when it runs, this is what it looks like:
----
C:\Programfiler\FlashFXP\FlashFXP.exe -upload SITE -localpath="D:\Download\Ferdig\"..\FILE.TXT"" -remotepath="/UPLOAD/"..\FILE.TXT""
---

So FlashFXP doesnt load the file correctly. Is there anyway i could trim the sting to just be : FILE.TXT, with no "..\ at the start and drop the " at the end?

Great script:)

Regards,
Christopher

Last edited by dossa (2006-11-20 16:29:45)

Offline

#14 2007-05-07 11:15:29

cecolon
Member

Re: Run external program on events (global!)

Hi, after looking through about ten pages in the request forum, trying to find new posts about this feature request, I only found a couple that were closed because they were previously requested. Therefore i bump this thread.

Are there any news regarding this feature? It would make this great piece of software yet more useful, as I (and everyone else) would be able to make it do whatever we want when files are complete smile

Admins, are you concidering implementing this, or could you explain why it won't be implemented?

Last edited by cecolon (2007-05-07 11:15:52)

Offline

#15 2007-05-14 09:33:03

Spartakus
Member

Re: Run external program on events (global!)

cecolon wrote:

Admins, are you concidering implementing this, or could you explain why it won't be implemented?

Yeah, would like to know that too smile

Offline

#16 2007-05-14 22:25:50

Firon
Administrator

Re: Run external program on events (global!)

It may happen eventually.

Offline

#17 2007-07-19 19:42:27

phunkyfish
Member

Re: Run external program on events (global!)

The feature list says that this is implemented, but I'll be damned if I can find it in uTorrent 1.7.1?


Sometimes things work, sometimes they don't!

Offline

#18 2007-07-19 20:13:05

Ultima
Administrator

Re: Run external program on events (global!)

Eh? Where?


[size=0.85][ Tweaking Checklist | User Manual | BEE | MiniUI | µTA ][/size]

Offline

#19 2007-07-20 04:59:56

phunkyfish
Member

Re: Run external program on events (global!)


Sometimes things work, sometimes they don't!

Offline

#20 2007-07-20 07:47:05

Ultima
Administrator

Re: Run external program on events (global!)

Oh. The title was misleading for the item in the list; it didn't write global, and admittedly, I didn't visit the thread before marking it as implemented.

Fixed the listing, and added the (global) to the title.


[size=0.85][ Tweaking Checklist | User Manual | BEE | MiniUI | µTA ][/size]

Offline

#21 2007-08-07 11:52:48

Tanatos
Member

Re: Run external program on events (global!)

I've edited the code of the program, so it executes a program after a download is complete. But I'm not sure that I should share it... I've injected simple code and the address of the executed program is stored at specific location. This address can be easily changed with a hex editor...

Offline

#22 2007-08-07 12:21:28

phunkyfish
Member

Re: Run external program on events (global!)

That sounds pretty cool! I'd certainly be interested! I guess we'll wait and see if the moderators/coders approve!

It would certainly prove problematic as new versions are released. But the ability to run a program on complete download is a very much needed feature in uTorrent...

If you did it easily enough I don't see why it can't be added to uTorrent straight away... (Wishful thinking smile)


Sometimes things work, sometimes they don't!

Offline

#23 2007-08-07 14:21:03

Alneven
Member

Re: Run external program on events (global!)

Please vote here:

this is for "Improve "run this program when download finishes" feature"
http://utorrent.nitescifi.com/index.php … se&s=4#272

it will be very useful and I can sleep without problems big_smile

Last edited by Firon (2007-08-09 01:45:02)

Offline

#24 2007-08-08 02:00:32

phunkyfish
Member

Re: Run external program on events (global!)

The feature item your talking about is here: http://utorrent.nitescifi.com/index.php … se&s=4#272

You shouldn't list the link to the yes vote, just to the item on the page...

It kinda incorporates the feature this topic represents, which is here: http://utorrent.nitescifi.com/index.php … se&s=4#246

Last edited by phunkyfish (2007-08-08 02:03:48)


Sometimes things work, sometimes they don't!

Offline

#25 2007-10-01 02:02:34

kiran_6584
Member

Re: Run external program on events (global!)

how to set the advanced properties for Execute External Program using InstallJammer for Windows to execute a .bat file.

Offline

Board footer

Powered by FluxBB