Post processing script to clean up unwanted files

Get help with all aspects of SABnzbd
Forum rules
Help us help you:
  • Are you using the latest stable version of SABnzbd? Downloads page.
  • Tell us what system you run SABnzbd on.
  • Adhere to the forum rules.
  • Do you experience problems during downloading?
    Check your connection in Status and Interface settings window.
    Use Test Server in Config > Servers.
    We will probably ask you to do a test using only basic settings.
  • Do you experience problems during repair or unpacking?
    Enable +Debug logging in the Status and Interface settings window and share the relevant parts of the log here using [ code ] sections.
Post Reply
sparker366
Newbie
Newbie
Posts: 31
Joined: December 31st, 2012, 9:12 am

Post processing script to clean up unwanted files

Post 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
User avatar
shypike
Administrator
Administrator
Posts: 19773
Joined: January 18th, 2008, 12:49 pm

Re: Post processing script to clean up unwanted files

Post by shypike »

You can start by setting up an extension-based cleanup filter in Config->General.
sparker366
Newbie
Newbie
Posts: 31
Joined: December 31st, 2012, 9:12 am

Re: Post processing script to clean up unwanted files

Post 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.
User avatar
sander
Release Testers
Release Testers
Posts: 9429
Joined: January 22nd, 2008, 2:22 pm

Re: Post processing script to clean up unwanted files

Post 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?
sparker366
Newbie
Newbie
Posts: 31
Joined: December 31st, 2012, 9:12 am

Re: Post processing script to clean up unwanted files

Post 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.
Post Reply