[Tool, Windows] Auto Extract finnished uTorrent and optionally delete archives
#1
The problem I had when I started writing this script is that I couldn't find any unpacker that would extract and delete archives for a torrent after a certain period of time or after a certain seed ratio had been reached.

This script will wait for a set amount of hours when a torrent finishes before extracting, deleting archives, moving files into its right location, scraping with EMM or EMM-R (command-line) AND notify XBMC of your new download and update its library.

Fully automated media center, in just a single batch. No need for eventghost, the renamer or all that jazz.

This script will NOT stop your torrents, but they will probably fail after it has deleted the archive.

I'm downloading my TV-Series with RSS-feeds in uTorrent.
They are saved into:
K:\TV-Series\Supernatural\Season 06\Supernatural.S06E04.HDTV.XviD-REL\*.rar

But afterwards I have to extract the contents of the rar, and move it one folder up, like this:
K:\TV-Series\Supernatural\Season 06\supernatural.s06e04.hdtv.xvid-rel.avi

This script does that job automatically, among with some other things.

The script will also work for movies, with multiple subdirectories. Nod

Lets say you have it like this:
K:\Movies\Awesome.Movie.DVDRip.XviD-REL\CD 1\*.rar
K:\Movies\Awesome.Movie.DVDRip.XviD-REL\CD 2\*.rar

This script will then extract from both those folders into its parent folder. Like this:
K:\Movies\Awesome.Movie.DVDRip.XviD-REL\awesome.movie.cd1.dvdrip.xvid-rel.avi
K:\Movies\Awesome.Movie.DVDRip.XviD-REL\awesome.movie.cd2.dvdrip.xvid-rel.avi

It also works for single file movies.

From:
K:\Movies\Awesome.Movie.DVDRip.XviD-REL\*.rar

Into:
K:\Movies\Awesome.Movie.DVDRip.XviD-REL\awesome.movie.dvdrip.xvid-rel.avi

The script will try to delete these files and folders:

"<download_path>\CD{1-4}\"
"<download_path>\CD {1-4}\"
"<download_path>\Sample\"
"<download_path>\*.rar"
"<download_path>\*.sfv"
"<download_path>\*.r0{1-9}"
"<download_path>\*.r{10-99}"

Tested with uTorrent v2.2 Build 23703, Windows Server 2008 R2 x64.
!!! uTorrent v3.x has been reported to not work !!!

System Requirements
* uTorrent Version 2.2 (build 21882+)
* timeout (Windows Vista/7)
* WinRAR (with Command-Line unrar.exe)
* XBMC v10 (Dharma)
* EMM/EMM-r

Timeout
A new command in Vista/7 is "timeout". It will cause the command processor to wait for a specified number of seconds or until a key is pressed.

Website
Always check the website, I will not keep this post updated if it doesn't involve a major change
http://bit.ly/g26fH6#autoextract

Edit config.cmd to suit your needs.

Call the script from within uTorrents GLOBAL settings.
Options, Preferences, Advanced, Run Program, Run this program when a torrent finishes:
Code:
"C:\AutoExtract.bat" "%N" "%D" "%L"
uTorrent will parse it like this:

A movie download, labeled "Movie":
Code:
"C:\AutoExtract.bat" "Awesome.Movie.DVDRip.XviD-REL" "K:\Movies\Awesome.Movie.DVDRip.XviD-REL" "Movie"

A tv-show download, labeled "TV-Show":
Code:
"C:\AutoExtract.bat" "Supernatural.S06E04.HDTV.XviD-REL" "K:\TV-Series\Supernatural\Season 06\Supernatural.S06E04.HDTV.XviD-REL" "TV-Show"

EDIT: You know what they say, a picture says more than a thousand words
Image

Notification from above script when a new movie is added
Image

Notification from above script when a new episode is added
Image
Reply
#2
Smile 
I want test soldiers!
Reply
#3
I use eventghost to monitor the directory, when the file finishes it launches SCRU via command line, which unpacks the new files to a specified folder, renames the files to the parent directory and then does a bunch of other stuff as well. More details on the setup can be found via the link in my sig. All of this can be done instantly as well...no waiting for seeding.
HTPC Specs:
95w 3 core AMD Phenom 8750 2.4GHz / MSI Media Live Diva 5.1 (MS-7411) Motherboard / On-board ATI Radeon HD3200 / On-board preamp 5.1 sound card / 4 x 1 terabyte sata segate 7200.12 / 8GB SDRAM / CORSAIR CMPSU-450VX 450W / SILVERSTONE Media Center HTPC Case / 1080p 42" Dynex LCD \ 5.1 Polk Audio Surround Sound - RM6750

Details of my fully automated, virtual Windows 7, HTPC setup here
Reply
#4
Flook Wrote:I use eventghost to monitor the directory, when the file finishes it launches SCRU via command line, which unpacks the new files to a specified folder, renames the files to the parent directory and then does a bunch of other stuff as well. More details on the setup can be found via the link in my sig. All of this can be done instantly as well...no waiting for seeding.


Seems like a lot of work for the same result. I'm just gonna add the command-line so that it scrapes via ember media manager when unrared.
Reply
#5
Surprise, I have added some more features.

The script will now scrape with EMM/EMM-r and after that it will notify XBMC about your new download AND update it's library. (Requires XBMC's web server ON)
Inspiration from watzen (http://forum.xbmc.org/showthread.php?tid=87472)

All done in a single batch script. No user input required!

Either grab it from my first post or my website http://bit.ly/g26fH6
Reply
#6
Quote:But afterwards I have to extract the contents of the rar, and move it one folder up, like this:
why do you "have to" unrar the files? XBMC can play from uncompressed rar-archives.
  • Livingroom - C2D E8400, P5N7A-VM on a Samsung 46" LE46M86 FullHD via HDMI
  • Kitchen - ASRock 330 HT Displayed on a Samsung Lapfit 22" dual touch screen LD220Z
  • Bedroom - LG Laptop on a 32" tv
Reply
#7
watzen Wrote:why do you "have to" unrar the files? XBMC can play from uncompressed rar-archives.

For performance, I dont like buffering over from a NAS as I'm currently have it setup.
Reply
#8
njumlin Wrote:For performance, I dont like buffering over from a NAS as I'm currently have it setup.

I still don't get it? The same buffering occurs when streaming from rars as from mkvs/avis... I think?
  • Livingroom - C2D E8400, P5N7A-VM on a Samsung 46" LE46M86 FullHD via HDMI
  • Kitchen - ASRock 330 HT Displayed on a Samsung Lapfit 22" dual touch screen LD220Z
  • Bedroom - LG Laptop on a 32" tv
Reply
#9
watzen Wrote:I still don't get it? The same buffering occurs when streaming from rars as from mkvs/avis... I think?

Nope, its a quite big difference, it will need to buffer from rar and then buffer mpg/avi/mkv.
Reply
#10
The script is really stable now, however I would really like some feedback from anyone.
Reply
#11
Great Project.
Gonna test your script,
hope it won't delete any hdds :-P

btw, you should add some kind of build no. to your attached File

Cheers
.
Cheers
ubuntuf4n
Reply
#12
ubuntuf4n Wrote:Great Project.
Gonna test your script,
hope it won't delete any hdds :-P

btw, you should add some kind of build no. to your attached File

Cheers

Yippie! My first test person Smile

It will only delete these:
"<download_path>\CD{1-4}\"
"<download_path>\CD {1-4}\"
"<download_path>\Sample\"
"<download_path>\*.rar"
"<download_path>\*.sfv"
"<download_path>\*.r0{1-9}"
"<download_path>\*.r{10-99}"

Great idea, I'll add that in 2 hours.

From a PM:
ubuntuf4n Wrote:hi
i am using vuze.
is your tool independent from the torren-client, or will it not work with mine?

That depends on how vuze works, are you able to set a "Run this program when a torrent finishes"

With these parameters:
AutoExtract.bat "<Torrent Title>" "<Download path>" "<Label>"
Reply
#13
njumlin Wrote:Yippie! My first test person Smile

It will only delete these:
"<download_path>\CD{1-4}\"
"<download_path>\CD {1-4}\"
"<download_path>\Sample\"
"<download_path>\*.rar"
"<download_path>\*.sfv"
"<download_path>\*.r0{1-9}"
"<download_path>\*.r{10-99}"

Great idea, I'll add that in 2 hours.
...

Big Grin
njumlin Wrote:...

From a PM:


That depends on how vuze works, are you able to set a "Run this program when a torrent finishes"

With these parameters:
AutoExtract.bat "<Torrent Title>" "<Download path>" "<Label>"

I am not sure about these parameters, but I found this helpful documentation: LINK1 and LINK2.

If this could be integrated, then this would be a really great thing,
especially if you're using RSS-Feeds with Auto-Download.
Vuze is a pretty cool tool, imho.

btw, I will do the download-test tommorrow evening.

Cheers
.
Cheers
ubuntuf4n
Reply
#14
ubuntuf4n Wrote:I am not sure about these parameters, but I found this helpful documentation: LINK1 and LINK2.

If this could be integrated, then this would be a really great thing,
especially if you're using RSS-Feeds with Auto-Download.
Vuze is a pretty cool tool, imho.

btw, I will do the download-test tommorrow evening.
Cheers
I did a quick look on those pages, couldn't find anywhere to setup "Run this program when a torrent finishes".

Anyway, I believe vuze is the new name of Azureus?
That program is built in Java, it leaks memory and eat up a lot of your system resources.
I would recommend you to use uTorrent instead, you can setup RSS feeds there too.
Reply
#15
I need a plugin, which is only available in vuze,
unfortunately there is no alternative available.
.
Cheers
ubuntuf4n
Reply

Logout Mark Read Team Forum Stats Members Help
[Tool, Windows] Auto Extract finnished uTorrent and optionally delete archives1