xuxaki Posted July 6, 2009 Report Share Posted July 6, 2009 Hi!I have a server at home, and i want to notify by e-mail, popup, php script, whatever when a download is complete.My uTorrent version is 1.7.7.Do i have some way to do this?Thanks Link to comment Share on other sites More sharing options...
DreadWingKnight Posted July 6, 2009 Report Share Posted July 6, 2009 My uTorrent version is 1.7.7.Which we don't support. Link to comment Share on other sites More sharing options...
xuxaki Posted July 6, 2009 Author Report Share Posted July 6, 2009 But this is not a problem, I can install a newer version (which you support). Link to comment Share on other sites More sharing options...
moogly Posted July 6, 2009 Report Share Posted July 6, 2009 Someome has written a guide to send a notification by SMS/email. Anyway you have to add the command line for each torrent job because uT has no global "run program" when a torrent is complete.http://www.bukisa.com/articles/46134_set-up-sms-and-email-notifications-for-utorrent Link to comment Share on other sites More sharing options...
xuxaki Posted July 6, 2009 Author Report Share Posted July 6, 2009 Thanks for the link!By the command line that works perfectly! But across uTorrent that doesn't work! And that's because uTorrent grab only the first token and execute him, i.e.:My full command is:C:\sendEmail-v155\sendEmail -t mymail@gmail.com -u Download: %N -m File stored on: %D -f mynick@iol.pt -s smtp.iol.pt:25 -xu mynick -xp mypassBut uTorrent pick ONLY C:\sendEmail-v155\sendEmail and execute that!There is no way to "tell" uTorrent to execute the FULL line and not only the firt token? I already try to add ' at the begin & end of the command, but nothing happens...Thanks Link to comment Share on other sites More sharing options...
moogly Posted July 6, 2009 Report Share Posted July 6, 2009 Sorry I don't know about that. Maybe you can post a comment on the guide's webpage. Link to comment Share on other sites More sharing options...
xuxaki Posted July 6, 2009 Author Report Share Posted July 6, 2009 post a comment on the guide's webpagewhere is that? :x Link to comment Share on other sites More sharing options...
moogly Posted July 6, 2009 Report Share Posted July 6, 2009 You have to join the site before commenting: http://www.bukisa.com/join Link to comment Share on other sites More sharing options...
xuxaki Posted July 6, 2009 Author Report Share Posted July 6, 2009 SOLVED!instead of execute directly the sendmail command on uTorrent (which is quite large), i've created a .bat file that received and parse the parameters (separated by @) I want from uTorrent and send the email. Give you the code of my execute.bat file, that can help someone in the future :@echo offSET input= SET name=::Mainif /i "%1"=="" goto :ExitBatchIF "%1"=="@" GOTO NewStringIF "%1"=="-" GOTO PassSET temp=%1SET input=%input% %temp%shiftgoto :Main:NewStringSET name=%name% %input%SET input= shiftGOTO Main:PassshiftGOTO Main:ExitBatchC:\sendEmail-v155\sendEmail -t mymail@gmail.com -u Download completed: %name% -m Download directory: %input% -f mynick@domain.com -s smtp.domain.com:25 -xu mynick -xp mypasswordOn uTorrent simply put the following code:C:\sendEmail-v155\execute.bat %N @ %D Link to comment Share on other sites More sharing options...
gmansa Posted August 31, 2009 Report Share Posted August 31, 2009 I used the WebUI API as a workaround, not my best coding ever but a quick fix. It does stop completed downloads however in order to only alert you once.Run the PHP script below in cron (works from remote server):<?php$webUI_url = "URL";$webUI_port = PORT;$webUI_user = "USER";$webUI_pass = "PASS";$emailto="to@email.com";$headers = "From: from@email.com";$ch = curl_init();curl_setopt($ch, CURLOPT_URL, "http://$webUI_url:$webUI_port/gui/?list=1" );curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);curl_setopt($ch, CURLOPT_USERPWD, "$webUI_user:$webUI_pass");if ( $response = curl_exec( $ch ) ) { //echo $response; $obj = json_decode($response,true); $torrents = $obj['torrents']; //echo count($torrents,0); //print_r($torrents); $arrsize = count($torrents); for ($i=0; $i<$arrsize; $i++) { if (($torrents[$i][4] == 1000) && ($torrents[$i][1] == 200)) { echo $torrents[$i][0]; curl_setopt($ch, CURLOPT_URL, "http://$webUI_url:$webUI_port/gui/?action=stop&hash=".$torrents[$i][0]); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); curl_setopt($ch, CURLOPT_USERPWD, "$webUI_user:$webUI_pass"); if ( $responsestop = curl_exec( $ch ) ) { if ($responsestop != "invalid request") { $name = $torrents[$i][2]; $label = $torrents[$i][11]; $subject = "Download completed: " . $name; $txt = "Name: " . $name . "\r\n" . "Label: " . $label; mail($emailto,$subject,$txt,$headers); } } } }}else { echo 'Server not found';}curl_close($ch);?> Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.