Automatic Torrent Extractor/Mover Script
Thanks for visiting Daily Cup of Tech!
Here are a few things that you may want to do while you are visiting:
- Subscribe to the RSS feed
- Take a theme tour and check out some of the best DCoT posts
- Check out our latest posts
It has been long time since I have watched television like “normal” people. Ever since I found bittorrent, there was no turning back!
The problem that I have is that I am a pack rat! Once I download a TV episode, I don’t want to get rid of it. After all, I used up all that bandwidth!
So, I’ve started organizing my television shows into three categories:
- Downloaded - these are shows that have just completed downloading and are in their original form from the Internet
- Unsorted - these shows are in in one central location and should be in playable format. These are all my new shows that I probably have not watched yet
- Sorted - once I have watched a show, the shows get moved into appropriate folders based on series and season name
The issue that I have run into in the past is that once an episode is downloaded, it may not be in playable format since many shows are archived, typically into RAR files. This means that I needed to manually extract these files or move the playable files to the Unsorted folder so that I could watch them.
I finally got fed up with this and I thought that there had to be a better way. It took me a couple of evenings work but I finally came up with a batch files that does the work for me! I simply have Windows programmed to run the batch file on a regular basis and it extracts all of the RAR files to my preferred location and moves all of the AVI files there as well (without copying the samples).
Here is the contents of that batch file:
@echo off
setlocal
cls
rem Set program variables below:
rem sourcedir - where files are saved once they have been downloaded
set sourcedir=C:\Downloaded
rem destinationdir - where you want all of the playable files to be placed
set destinationdir=C:\Unsorted
rem winrarpath - location of the unrar program
set winrarpath=C:\Program Files\WinRAR\
rem filelist - the name of the file which will store all of the RAR and AVI file names that have been processed
set filelist=FoundFiles.txt
rem tempfile - name of the temporary file that will be created and then deleted during the cleanup process
set tempfile=TempFile.txt
set path="%winrarpath%";%path%
echo Extracting new RAR files...
for /R "%sourcedir%" %%R IN (*.rar) DO find /C "%%R" %filelist% > NUL & if errorlevel 1 call unrar e -o- -y "%%R" *.* %destinationdir%\ & echo %%R>>%filelist%
echo Adding sample AVI files to no copy list...
for /R "%sourcedir%" %%R IN (*sample*.avi) DO find /C "%%R" %filelist% > NUL & if errorlevel 1 echo %%R>>%filelist%
echo Moving new AVI files...
for /R "%sourcedir%" %%R IN (*.avi) DO find /C "%%R" %filelist% > NUL & if errorlevel 1 echo Copying %%R... & copy "%%R" %destinationdir%\ & echo %%R>>%filelist%
echo Cleaning up %filelist%...
for /F %%R IN (%filelist%) DO if exist "%%R" echo %%R>>%tempfile%
del %filelist%
rename %tempfile% %filelist%
All you need to do is copy this file and save it as TorMove.cmd. Then edit the three variables:
- sourcedir
- destinationdir
- winrarpath
- filelist
- tempfile
Only the first three are critical. You just need to make sure that the last two do not clash with other files.
Also, you do not need to use WinRAR. If you do not have this program, UnRAR for Windows will work just fine.
Once you have modified your file, save it and then schedule Windows to run it as often as you want!
If you found this post useful, why don't you buy me a cup of coffee to show your gratitude?
Building forms for your website is a real pain in the backside. There are so many different aspects of the form that you need to know in order to get everything just right.
There are a lot of people out there who are sending our e-mail after e-mail and offending everyone on their way, completely oblivious to what they are doing. We all experience them regularly. these are the people who WRITE IN ALL CAPS, > > > > > forward e-mails that have been forwarded several times previously, use REPLY ALL to respond to distribution lists, and attach 50 MB files that clock up our Internet connections.
Every few months, I like to completely blow away my
UPS devices have become so cheap these days that everyone should have one on all of their computers. What surprises me is that nobody has designed a standard computer power supply with built-in UPS capabilities.
It is only a matter of time before most IT professionals find themselves having to do some sort of a forensic analysis on a computer. The problem that most people come are then faced with is their lack of experience in performing these tasks.
Many of you are familiar with the concept of computer imaging. Essentially, you take a system, configure it the way that you would like, and then duplicate the hard drive to all of the other systems, saving yourself all of the same steps that you did on the first system.
Friday was my last day of work before the big move. I have had to leave jobs a number of times in my IT career and I think this was probably one of my best exits so far. With the average person changing jobs several times over their careers, leaving one’s job with class is an extremely important skill to master.
It is quite popular these days to hire a headhunter when looking for work. And, on the surface, I thought it was a great idea. Why should I pound the pavement looking for jobs when these people do this full time and are willing to find me work without charging me? They get paid by the companies who are looking for employees and they get a percentage of my first year’s salary. This means that they would get me the largest possible salary and it doesn’t cost me a dime!