Media Center Master community forums
http://forums.MediaCenterMaster.com/

SabNZBd post-processing script for separating downloads
http://forums.MediaCenterMaster.com/viewtopic.php?f=7&t=7299
Page 2 of 2

Author:  dizzelk [ January 22nd, 2014, 12:54 pm ]
Post subject:  Re: SabNZBd post-processing script for separating downloads

Don't forget to use double '%%' in the batch file. I get the error: ( was unexpected at this time I found the solution here
Here is what mine looks like:

@ECHO OFF
REM **
REM ** If SabNZBd says the processing completed successfully...
REM **
IF %%7 == 0 (
CD /D %%1
IF EXIST *.mkv (
REM **
REM ** ... and this folder has an MKV video, then we must have downloaded a movie or TV episode ...
REM **
CD \
ECHO This is a *VIDEO* and is being moved accordingly...
MOVE %%1 E:\Downloads\MediaMaster_Parser
EXIT 0
)

IF EXIST *.mp4 (
REM **
REM ** ... or this folder has an MP4 video, then we must have downloaded a movie or TV episode ...
REM **
CD \
ECHO This is a *VIDEO* and is being moved accordingly...
MOVE %%1 E:\DONE\MediaMaster_Parser
EXIT 0
)

IF EXIST *.avi (
REM **
REM ** ... or this folder has an AVI video, then we must have downloaded a movie or TV episode ...
REM **
CD \
ECHO This is a *VIDEO* and is being moved accordingly...
MOVE %%1 E:\DONE\MediaMaster_Parser
EXIT 0
)

IF EXIST *.ts (
REM **
REM ** ... or this folder has a ts video, then we must have downloaded a movie or TV episode ...
REM **
CD \
ECHO This is a *VIDEO* and is being moved accordingly...
MOVE %%1 E:\DONE\MediaMaster_Parser
EXIT 0
)

IF EXIST *.wmv (
REM **
REM ** ... or this folder has a wmv video, then we must have downloaded a movie or TV episode ...
REM **
CD \
ECHO This is a *VIDEO* and is being moved accordingly...
MOVE %%1 E:\DONE\MediaMaster_Parser
EXIT 0
)


REM **
REM ** ... otherwise ...
REM **
CD \
ECHO This is a miscellaneous download and is being moved accordingly...
MOVE %%1 E:\DONE\Other
EXIT 0
)

REM **
REM ** Tell SabNZBd that all is well with our script.
REM **
EXIT 0

Author:  Pete [ January 27th, 2014, 10:10 pm ]
Post subject:  Re: SabNZBd post-processing script for separating downloads

Nice tip -- wonder why it works for me without it.

Author:  chongwho [ December 13th, 2014, 1:39 am ]
Post subject:  Re: SabNZBd post-processing script for separating downloads

Okay. I am terrible with writing scripts etc, so I rely quite heavily on forums like here to assist.

I copied this script, but because I only use this script for movies, i don't need it to separate out everything. So I changed everything to go to the same folder. My Parser folder (ignore that is says sickbeard in the folder type, its just how it all ended up being named.

The first few times it worked great, it moved the movie folders (or file if it only downloaded a single file) to my parser folder. The script output in SAB read '2 files moved' or '7 files moved'.

For some reason, now it doesnt move any of the files, and the SAB Script says ran moviefile.bat (my script name) and the script log is empty.

I'm sure its probably a simple fix for someone that know what they're doing

Any help would be much appreciated.

Code:
@ECHO OFF
REM **
REM ** If SabNZBd says the processing completed successfully...
REM **
IF %%7 == 0 (
CD /D %%1
IF EXIST *.mkv (
REM **
REM ** ... and this folder has an MKV video, then we must have downloaded a movie or TV episode ...
REM **
CD \
ECHO This is a *VIDEO* and is being moved accordingly...
MOVE %%1 "C:\Users\User\Desktop\Louis\Downloads\Sickbeard\Parser"
EXIT 0
)

IF EXIST *.mp4 (
REM **
REM ** ... or this folder has an MP4 video, then we must have downloaded a movie or TV episode ...
REM **
CD \
ECHO This is a *VIDEO* and is being moved accordingly...
MOVE %%1 "C:\Users\User\Desktop\Louis\Downloads\Sickbeard\Parser"
EXIT 0
)

IF EXIST *.avi (
REM **
REM ** ... or this folder has an AVI video, then we must have downloaded a movie or TV episode ...
REM **
CD \
ECHO This is a *VIDEO* and is being moved accordingly...
MOVE %%1 "C:\Users\User\Desktop\Louis\Downloads\Sickbeard\Parser"
EXIT 0
)

IF EXIST *.ts (
REM **
REM ** ... or this folder has a ts video, then we must have downloaded a movie or TV episode ...
REM **
CD \
ECHO This is a *VIDEO* and is being moved accordingly...
MOVE %%1 "C:\Users\User\Desktop\Louis\Downloads\Sickbeard\Parser"
EXIT 0
)

IF EXIST *.wmv (
REM **
REM ** ... or this folder has a wmv video, then we must have downloaded a movie or TV episode ...
REM **
CD \
ECHO This is a *VIDEO* and is being moved accordingly...
MOVE %%1 "C:\Users\User\Desktop\Louis\Downloads\Sickbeard\Parser"
EXIT 0
)


REM **
REM ** ... otherwise ...
REM **
CD \
ECHO This is a miscellaneous download and is being moved accordingly...
MOVE %%1 "C:\Users\User\Desktop\Louis\Downloads\Sickbeard\SAB_OTHER"
EXIT 0
)

REM **
REM ** Tell SabNZBd that all is well with our script.
REM **
EXIT 0


The first

Author:  djp1701 [ September 11th, 2016, 2:36 pm ]
Post subject:  Re: SabNZBd post-processing script for separating downloads

I just installed sabNZBd and am trying to get the post-processing script to work. I am receiving he following error upon the execution of the bat file almost as though something is wrong with the encoding...any suggestions?:

C:\Program Files (x86)\SABnzbd>IF %7 == 0 (
~á ~áCD /D %1
~á ~áIF EXIST *.mkv (
~á ~á~á ~áREM **
~á ~á~á ~áREM ** ... and this folder has an MKV video, then we must have downloaded a movie or TV episode ...
~á ~á~á ~áREM **
~á ~á~á ~áCD \
~á ~á~á ~áECHO This is a *VIDEO* and is being moved accordingly...
~á ~á~á ~áMOVE %1 "E:\MCM Download Parser\"
~á ~á~á ~áEXIT 0
~á ~á
)

Author:  djp1701 [ September 11th, 2016, 4:17 pm ]
Post subject:  Re: SabNZBd post-processing script for separating downloads

...and the error is:

C:\Program Files (x86)\SABnzbd>~á ~á
'~á' is not recognized as an internal or external command,
operable program or batch file.

Author:  djp1701 [ September 18th, 2016, 7:47 am ]
Post subject:  Re: SabNZBd post-processing script for separating downloads

Still not sure why the batch script was not executing correctly when others do...thinking maybe the code was powershell or some other scripting language not recognized by my system in the BAT format. Anyway, I found a script that would allow filebot to handle post processing in much the similar manner that the one I have for uTorrent does. All is working as expected...getting my media server more and more automated by the week. Thank you!

Author:  Pete [ December 4th, 2016, 2:06 pm ]
Post subject:  Re: SabNZBd post-processing script for separating downloads

Those are TAB whitespace characters, so it looks like your computer did not handle the encoding well. Try changing the encoding in a text editor such as Notepad++. This is a standard batch file, not PowerShell or anything else.

Page 2 of 2 All times are UTC - 7 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/