I wanted to somehow set up the ability to give a command to my home computer to start downloading a torrent by sending a torrent file by email to a special address, and when the download is finished, receive the corresponding notification by email. And did.
Additional conditions:
- There is a round-the-clock computer with Windows 7. We will use it.
- Login is not automatic, i.e. may not be done.
- I do not want to create my own software product. We will use ready.
We will start the application scheduler from the user SYSTEM when the computer starts. To overcome the lack of a “correct” user and its directories, we will use the portable versions.
Take:
- To send emails with notifications blat.exe and stunnel ;
- uTorrent ;
- To receive emails with an attached Thunderbird file with attachmentextractor .
Customize:
1. blat.exe and stunnel
A notification about the end of the download will be sent from Gmail.
Required settings are described
here .
Briefly:
1.1. Download the application, install stunnel.
1.2. Rule stunnel.conf in the stunnel folder.
')
# GLOBAL OPTIONS
client = yes
output = stunnel-log.txt
debug = 0
taskbar = no
# SERVICE-LEVEL OPTIONS
[SMTP Gmail]
accept = 127.0.0.1:1099
connect = smtp.gmail.com:465
1.3. In the command line we execute:
blat -install smtp.gmail.com youremail@gmail.com -u gmailusername -pw gmailpassword – - gmailsmtp
2. UTorrent
2.1. Install uTorrentPortable (tested on version 3.1.3), customize to your own needs, as well as in Settings:
- Folders> We specify the folder “Startup of torrents from:” In it we will save the torrent files received by email.
- Speed> "Max. Recoil speed". Here in some cases it makes sense to put a smaller value, because As part of this decision, you will not be able to remotely stop the distributions, and they will continue until your direct intervention. Minimum - 1 Kb / s; and 0 is, on the contrary, unlimited.
2.2. In Task Scheduler, create a task to launch uTorrentPortable with the following settings:
- Use user account: "system";
- Select "Perform regardless of user registration";
- Select "Run with the highest rights." This is necessary not for uTorrent itself, but for the successful launch of stunnel when sending notifications (see below );
- Trigger: "When you turn on the computer."
Testing the start / end of uTorrentPortable from under SYSTEM showed that if it crashes, the PortableApps.comLauncherRuntimeData-uTorrentPortable.ini file remains in the uTorrentPortable \ Data \ folder, which makes it impossible to start the program again.
Therefore, in the “Actions” before launching uTorrentPortable, we add the launch of this clearini.bat:
set SETTINGSFILE="d:\uTorrentPortable\Data\PortableApps.comLauncherRuntimeData-uTorrentPortable.ini"
if exist %SETTINGSFILE% (del %SETTINGSFILE%) else (echo ok)
3. Thunderbird
3.1. Install Thunderbird portable
Clarification just in case: tested on thunderbird portable version 12.0
Customize the receipt of mail.
Install add
attachmenttextractor .
In the attachmentextractor settings we specify:
- General> Default Save Path> utorrent folder for autoload, and also, just in case, switch “Always replace existing file with new attachment”.
- After extracting> turn on “Mark message as read” and “Delete message”. This is important, otherwise you will probably restart again after restarting.
- Auto Extract> turn on “Automatically extract attachment when receiving a letter” and “Run only Auto-Extract for messages that have attachments”.
3.2. Experiments on the launch of Thunderbird portable from under SYSTEM have revealed that the application still needs a temporary user folder.
Therefore, to start use the following Start.bat:
@echo off
setlocal enableextensions
set TMP=%~dp0temp-folder
"%~dp0ThunderbirdPortable.exe"
Endlocal
We save it in the folder with ThunderbirdPortable.exe and create the temp-folder folder there.
3.3. In the task scheduler we create the start.bat start task with the following settings:
- Use user account: "system";
- Select "Perform regardless of user registration";
- You can choose not to "Run with the highest rights";
- Trigger: "When you turn on the computer."
4. Create a torrent_finish.bat
set debug=-debug -log blat.log -timestamp
"C:\Program Files\stunnel\stunnel.exe" -start -quiet
D:
CD D:\Soft\blat
blat.exe -p gmailsmtp -to youremail@gmail.com -subject "%~1" -body "Loaded." -charset windows-1251 -server 127.0.0.1:1099 %debug%
"C:\Program Files\stunnel\stunnel.exe" -stop -quiet
In uTorrent settings:
Advanced> Launch Program> Run This Program When The
torrent_finish.bat "%N"
>
torrent_finish.bat "%N"
The system will be ready to work after each restart of the computer.
There are many other solutions that remotely control the torrent client. Here
are 4 ways
at once, and even special software here.