Jump to content

Batch, winrar, copy and uTorrent

ziogref

So this is what I have.

Server 2012r2

uTorrent

Member of "Tracker1" (has files as .mkv and .mp4)

Member of "Tracker2" (has .mkv and .mp4 in multi part rar's)

Winrar (Will be willing to use other software)

Downloads are saved to G:\torrents

End destination G:\Videos

 

So when my server downloads a torrent it goes to D:\Downloads. Once it finishes downloading it moves it to G:\Torrents. After it finishes downloading I want any files from Tracker1 to copy over to G:\Videos (Just video files) and I want any files from Tracker2 to extract the multi part rar's to G:\Videos. 

 

My end goal is that uTorrent can seed the original downloaded files and when they finish seeding 4 months those files can be deleted. (Manual) and the copied files remain intact. My question, how do I get utorrent to "copy or extract" the files once they have finished moving the originals from D:\Download to G:\Torrents Final destination for the copied/extracted files being G:\videos. 

I do live in Australia (it being 10pm) so I want be able to respond to anything for the next 12-14hours.

Link to comment
Share on other sites

Link to post
Share on other sites

you can just torrent into G:\ torrents btw, makes life a bit easier. in batch there is a way to check what file typ a file is and then you can just move it over with it

I spent $2500 on building my PC and all i do with it is play no games atm & watch anime at 1080p(finally) watch YT and write essays...  nothing, it just sits there collecting dust...

Builds:

The Toaster Project! Northern Bee!

 

The original LAN PC build log! (Old, dead and replaced by The Toaster Project & 5.0)

Spoiler

"Here is some advice that might have gotten lost somewhere along the way in your life. 

 

#1. Treat others as you would like to be treated.

#2. It's best to keep your mouth shut; and appear to be stupid, rather than open it and remove all doubt.

#3. There is nothing "wrong" with being wrong. Learning from a mistake can be more valuable than not making one in the first place.

 

Follow these simple rules in life, and I promise you, things magically get easier. " - MageTank 31-10-2016

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

If i was to do what you want; I would use transmission-cli on linux; write instructions as a bash script; set as a cron job. transmission has a nice web interface too

             ☼

ψ ︿_____︿_ψ_   

Link to comment
Share on other sites

Link to post
Share on other sites

10 hours ago, SCHISCHKA said:

If i was to do what you want; I would use transmission-cli on linux; write instructions as a bash script; set as a cron job. transmission has a nice web interface too

The reason Im using windows is because of Data de-duplication. Real killer for me, saves more than 2tb on media on my setup.

10 hours ago, Bananasplit_00 said:

you can just torrent into G:\ torrents btw, makes life a bit easier. in batch there is a way to check what file typ a file is and then you can just move it over with it

The reason I have it go from D:\Downloads to G:\Torrents. Is because the D drive is a Samsung Pro 120gb ssd (for the 10 year Warranty), its there so a torrent downloads to that then flushes to my 4tb raid. Downloading straight to the raid (while seeding ~300-400 torrents) cause utorrent to crash and the whole system coming to a hault. I think the is due to the nature of how torrents download and not playing nice with the super high activity times on the raid (before the ssd, there was a wait time of over 100 seconds for the HDD, SSD fixed this)

Link to comment
Share on other sites

Link to post
Share on other sites

qBittorrent is more configurable than uTorrent.

 

You can detect when a torrent is completed several ways (where you see app read qBitTorrent, too lazy to repeat myself so many times):

 

* by configuring app to put !qB in file name extensions - you know a torrent is done when there's no file with !qB in name

* by configuring app to move the .torrent file to another folder when download is done. Your script can monitor that folder and detect new torrent file in that folder, retrieve the folder name and start its job from there

* by configuring app to use a folder for incomplete torrents and another folder for complete torrents - when one torrent is completed the files are moved in this location, and if both folders are on same hard drive this happens almost instantly - your script can monitor the complete torrents folder every 20-30 seconds or so (which should be enough time for all files in a torrent to be moved from "incomplete" location to this location

* by configuring app to send an email to a mail server when the torrent is completed. you can use a free email server like hMailServer to create email accounts locally and receive emails and then your script could poll the email server  every 30s or so and retrieve  information about the last completed torrents

* by configuring app to execute an external application with the parameters required to keep track of torrent. for ex write a tiny app in C# or VB.net or Free Pascal that simply takes those arguments from the command line and saves them in a folder in a simple text file or in a database if you want to complicate your life and then your script which monitors that folder can read the new text files and start processing those folders.

 

You can write a separate script  that runs 24/7 in background.. it could be anything, vb.net , c# , Python etc but personally i'd probably write it in PHP as you can run php scripts locally without a web server.  For Windows apps there's unrar.dll , there's 7zip library which can unpack some formats, or you could just launch command line versions of winrar or 7zip and wait for them to extract the contents.  Your script can then create the torrent by itself (it's super easy file format, and languages like PHP have hashing functions builtin to hash the files), or you can just launch separate programs like mktorrent which have command line modes to create torrents. Your script can then copy the torrent file in a new folder which can be monitored by the app and automatically put to seeding

 

My advice would be to move to qBitTorrent anyway, seems just much better to me than uTorrent.

 

 

qbit.png

Link to comment
Share on other sites

Link to post
Share on other sites

10 hours ago, ziogref said:

The reason Im using windows is because of Data de-duplication. Real killer for me, saves more than 2tb on media on my setup.

The reason I have it go from D:\Downloads to G:\Torrents. Is because the D drive is a Samsung Pro 120gb ssd (for the 10 year Warranty), its there so a torrent downloads to that then flushes to my 4tb raid. Downloading straight to the raid (while seeding ~300-400 torrents) cause utorrent to crash and the whole system coming to a hault. I think the is due to the nature of how torrents download and not playing nice with the super high activity times on the raid (before the ssd, there was a wait time of over 100 seconds for the HDD, SSD fixed this)

well then that explains that, wrighting a script it batch shouldent be too hard, just use a lot of google when you need it to figure something out and someone will have had the problem or wharever before you and posted it on stack overflow lol

I spent $2500 on building my PC and all i do with it is play no games atm & watch anime at 1080p(finally) watch YT and write essays...  nothing, it just sits there collecting dust...

Builds:

The Toaster Project! Northern Bee!

 

The original LAN PC build log! (Old, dead and replaced by The Toaster Project & 5.0)

Spoiler

"Here is some advice that might have gotten lost somewhere along the way in your life. 

 

#1. Treat others as you would like to be treated.

#2. It's best to keep your mouth shut; and appear to be stupid, rather than open it and remove all doubt.

#3. There is nothing "wrong" with being wrong. Learning from a mistake can be more valuable than not making one in the first place.

 

Follow these simple rules in life, and I promise you, things magically get easier. " - MageTank 31-10-2016

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

5 minutes ago, Bananasplit_00 said:

well then that explains that, wrighting a script it batch shouldent be too hard, just use a lot of google when you need it to figure something out and someone will have had the problem or wharever before you and posted it on stack overflow lol

Im thinking powershell. I doubt my situation will apply to many people, since I got 3 copies of server 2012r2 for free. I will defiently get the end result and post it here, and maybe somewhere else as someone will also likely have my same problem. Its going to take a metric ton off effort to get this figured out since I have no coding skill (yet) and limited batch and powershell experience (I have written 1 batch script that I have ever gone into production). It will take some time (Weeks). In the mean time im going to be manually doing the extraction and moving while I do some other things first.

 

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, ziogref said:

Im thinking powershell. I doubt my situation will apply to many people, since I got 3 copies of server 2012r2 for free. I will defiently get the end result and post it here, and maybe somewhere else as someone will also likely have my same problem. Its going to take a metric ton off effort to get this figured out since I have no coding skill (yet) and limited batch and powershell experience (I have written 1 batch script that I have ever gone into production). It will take some time (Weeks). In the mean time im going to be manually doing the extraction and moving while I do some other things first.

 

move *.<extension> <other folder>

that bit of code may be of help im thinking, just change .<extension> to .mp4 or whatever and do that for all video file types you use, how to run it automaticly im not sure but thats a start atleast :) 

I spent $2500 on building my PC and all i do with it is play no games atm & watch anime at 1080p(finally) watch YT and write essays...  nothing, it just sits there collecting dust...

Builds:

The Toaster Project! Northern Bee!

 

The original LAN PC build log! (Old, dead and replaced by The Toaster Project & 5.0)

Spoiler

"Here is some advice that might have gotten lost somewhere along the way in your life. 

 

#1. Treat others as you would like to be treated.

#2. It's best to keep your mouth shut; and appear to be stupid, rather than open it and remove all doubt.

#3. There is nothing "wrong" with being wrong. Learning from a mistake can be more valuable than not making one in the first place.

 

Follow these simple rules in life, and I promise you, things magically get easier. " - MageTank 31-10-2016

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

Just now, Bananasplit_00 said:

move *.<extension> <other folder>

that bit of code may be of help im thinking, just change .<extension> to .mp4 or whatever and do that for all video file types you use, how to run it automaticly im not sure but thats a start atleast :) 

It would be a copy. But yeah that part is the easy part. Its the extraction and identification if its a .rar (multipart) or a video file before I do the copy. It might have to be multiple scripts. Dont know yet until I can work on it, also I might have multiple extensions .mkv .avi .mp4 etc

 

Link to comment
Share on other sites

Link to post
Share on other sites

So I think I figured it out. (untested) this is what I have

When a torrent changes state Run autoextract.bat

timeout 5 >nul
"C:\Program Files\WinRAR\WinRAR.exe" x -ibck -inul -o- "%D\*.r00" "G:\Videos"
timeout 120 >nul
Copy G:\Torrents\%F G:\Videos

Do you see any flaws in the above?

Parameters used by utorrent

%F - Name of downloaded file (for single file torrents)
%D - Directory where files are saved

 

(Note: the tracker that just has video files, the torrent name is the file name)

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×