Hi,
I found a lot of good answers in this site while searching for my problem but couldn't find specifically what I wanted. I'm also very rusty when it comes to switches and command line controllers, etc.
I don't know how many of you use uTorrent, but I use it to download my TV shows because I cannot afford cable. I have it running on a Windows 7 Server and it is hooked up directly to my TV. I have XBMC running to catalog everything for me and makes it easy to access.
The only problem that I've had this whole time is the long process of having to individually extract every episode after it's done downloading. uTorrent has a function in which it can run a program after the torrent has been downloaded. A lot of people mentioned that it's possible to call WinRAR through the command line or even create a batch file that gets called once the torrent downloads, looks for any *.001/*.rar files and extracts them in the same directory. Except, I have no clue how to write that. However, I can provide you with information that uTorrent provides:
In the "Run Program" section of the Torrent Properties when downloading, it offers 3 commands that can be used:
%F - Name of Downloaded File
%D - Directory where files are saved.
%N - Title of torrent
I'm guessing that the %D is going to be our lead. From what I wrapped around my head, here's the pseudo code of what i'm trying to do:
I don't know if unrar is registered under system commands or not, I'm assuming so:
unrar.exe %D (*.001 / *.rar) - There needs to be an if clause or something to figure out if the files are in *.001 format or *.rar format this way it extracts every form of archived rar files.
then:
delete all archive files except the extracted. Which in this case, we can extract the files to a subfolder and calling a delete command on all files in the main folder and leaving the subfolder intact with the extracted data.
I know this sounds long and tedious, but I don't know where else I'd go to ask.
Thanks in advance.
EDIT:
I've tried the following, except it didn't work. Nothing happened:
C:\Program Files\WinRAR\UnRAR.exe x -o- %D\*.* %D\
(Basically trying to extract anything in the directory to the directory itself)
When I test downloaded something, nothing got triggered. I'm not sure if it's uTorrent or WinRAR that's not configured right.