Page 1 of 1

Post processing script to clean up unwanted files

Posted: January 4th, 2013, 9:36 am
by sparker366
I was wondering if there was a way to write a script under windows 7/8 to remove all the garbage files from a download. I usually only download videos and they stuff a bunch of shortcuts and txt files and a sample video in there.

I just want the main video and the nfo file and want to get rid of the rest. I don't have this issue with anything but video files.

What would be the best way to do this?

If someone could point out what to use and maybe a brief guideline as how to set it up I could probably kludge something together. I do see that SAB does pass the directory name of what was processed so that could be passed to the script. I will have the script hard coded for the download directory thus all I have to do is append the passed directory name to it. Shortcuts are 1kb in size but the sizes of the other stuff is variable but the main video is going to at least 300mb or more. I really would like to keep the nfo if all possible but maybe if I just do a delete of all files less then 100mb it should clear everything out

Not sure what to use for this. Would something like http://www.autoitscript.com/site/autoit/ work for this

Re: Post processing script to clean up unwanted files

Posted: January 4th, 2013, 11:09 am
by shypike
You can start by setting up an extension-based cleanup filter in Config->General.

Re: Post processing script to clean up unwanted files

Posted: January 4th, 2013, 11:33 am
by sparker366
There are files in there with no extensions. Internet shortcut files have no extensions and I want to get rid of them. That is getting rid of of .sfv .gif .jpg .png .txt files which is fine.

Re: Post processing script to clean up unwanted files

Posted: January 4th, 2013, 12:58 pm
by sander
sparker366 wrote:There are files in there with no extensions. Internet shortcut files have no extensions and I want to get rid of them. That is getting rid of of .sfv .gif .jpg .png .txt files which is fine.
A 'del *.' (so extension '.') removes files without extension, so can you try if adding that extension to the SABnzbd config works for you?

Re: Post processing script to clean up unwanted files

Posted: January 4th, 2013, 1:36 pm
by sparker366
sander wrote:
sparker366 wrote:There are files in there with no extensions. Internet shortcut files have no extensions and I want to get rid of them. That is getting rid of of .sfv .gif .jpg .png .txt files which is fine.
A 'del *.' (so extension '.') removes files without extension, so can you try if adding that extension to the SABnzbd config works for you?
*. didn't work in there. Going to try .url which is what the shortcut extension is really. Going to see if that works. Will let you know.