|
Author |
Message |
Pete
|
Post subject: SabNZBd post-processing script for separating downloads Posted: May 27th, 2013, 6:52 pm |
|
 |
Developer/Owner |
 |
Joined: May 1st, 2009, 10:12 am Posts: 11701 Location: Meridian, ID, USA
|
|
If you use Media Center Master with SabNZBd, you may find this little script handy. It simply tries to determine if a download has video in it and if so, it'll move the download to a folder that Media Center Master can process -- otherwise it will move it elsewhere: 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 D:\Downloads\Auto-scan 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 D:\Downloads\Auto-scan 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 D:\Downloads\Auto-scan 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 D:\Downloads\Auto-scan 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 D:\Downloads\Auto-scan EXIT 0 ) REM ** REM ** ... otherwise ... REM ** CD \ ECHO This is a miscellaneous download and is being moved accordingly... MOVE %1 D:\Downloads\Other EXIT 0 )
REM ** REM ** Tell SabNZBd that all is well with our script. REM ** EXIT 0 Note that I use "D:\Downloads\Auto-Scan" for completed downloads that Media Center Master should parse and "D:\Downloads\Other" for everything else. You'll want to modify the script accordingly. For reference, I have SabNZBd's completed downloads in "D:\Downloads\Completed".
_________________ Peter Souza IV stable version 2.20.32820.456 / November 23rd, 2020 Media Center Master on Facebook!
|
|
|
|
 |
theimmortal
|
Post subject: Re: SabNZBd post-processing script for separating downloads Posted: September 30th, 2013, 4:22 am |
|
 |
Xvid Movie |
Joined: September 20th, 2013, 1:18 pm Posts: 33
|
Very nice script! I had it up and running nicely with SABnzbd up until a couple days ago. I am running a development build of 0.8.x and for some reason when it passes the folder name to the script it prefixes it with \\?\ (\\?\D:\Downloads\... instead of D:\Downloads\...) which of course throws a UNC error. I realize this is a bug/WIP issue with SABnzbd since I am running the development version, but I was hoping you could help me with a work around until this is fixed. Thank you!
|
|
|
|
 |
Pete
|
Post subject: Re: SabNZBd post-processing script for separating downloads Posted: September 30th, 2013, 12:35 pm |
|
 |
Developer/Owner |
 |
Joined: May 1st, 2009, 10:12 am Posts: 11701 Location: Meridian, ID, USA
|
Sure -- don't use a dev build of SabNZBd.  No, but seriously -- is there something in the dev builds you need? Clearly they're breaking essential functionality.
_________________ Peter Souza IV stable version 2.20.32820.456 / November 23rd, 2020 Media Center Master on Facebook!
|
|
|
|
 |
theimmortal
|
Post subject: Re: SabNZBd post-processing script for separating downloads Posted: October 1st, 2013, 6:42 pm |
|
 |
Xvid Movie |
Joined: September 20th, 2013, 1:18 pm Posts: 33
|
I hear you about running development software... I just can't help but play with things, even when they are working as intended. Nothing that I absolutely needed. I was getting a lot of downloads that needed repairs, and it was a lengthy process that was backing up my queue (completed downloads waiting for post-processing). The development version has some really nice features that dramatically improve the repair process as well as more features/options to manage your queue that I really like. I was thinking maybe something like a regex to strip the \\?\ from the variable before continuing, but I don't know how to implement something like that. Currently that is the only problem I have run into in 0.8.x.
|
|
|
|
 |
theimmortal
|
Post subject: Re: SabNZBd post-processing script for separating downloads Posted: October 9th, 2013, 7:44 am |
|
 |
Xvid Movie |
Joined: September 20th, 2013, 1:18 pm Posts: 33
|
|
I thought I would report back since I was able to get this working correctly again. Apparently the \\?\ is a built-in Windows function that allows commands to override the long filenames limitation. However, it isn't universally implemented throughout Windows, so CMD see's it as a network address and refuses to continue. So first I had to disable UNC checking with this registry entry: Under the registry path: HKEY_CURRENT_USER \Software \Microsoft \Command Processor add the value DisableUNCCheck REG_DWORD and set the value to 0 x 1 (Hex). The next obstacle was correcting some commands in the script to work with the new variables. It seems that CMD can utilize \\?\ for everything except changing directories (wierd). You can create a directory using md \\?\d:\new and it works just fine. You can also copy, move, etc. You just can't change directories. To overcome this I removed the "CD /D %1" from line 6, and changed all the IF statements to read "IF EXIST %1\*.ext". And SUCCESS! After that I was able to resume normal usage of the script. 
|
|
|
|
 |
chongwho
|
Post subject: Re: SabNZBd post-processing script for separating downloads Posted: December 11th, 2013, 3:23 am |
|
 |
Flash Video |
Joined: November 4th, 2013, 9:09 pm Posts: 15
|
I'm looking to get some help with the above script.
I have Sickbeard working well with SAB, and once a download is completed it runs SabToSickbeard.exe
When there is a movie completed in SAB, I would like to run a post processing script that moves the file to sab\downloads\complete\auto-scan folder (similar to above).
I am an absolute beginner with Scripts but it looks what you have above would work for my purposes. What I want to know is, how do I create the script above to work with SAB? Do I need to create an .exe like with SabToSickbeard? I tried creating a text file, but that does not seem to register as a usable script in SAB.
I know this is real beiginner stuff, but i nearly have everything running perfectly, and would like this last piece of the puzzle to be sorted.
Thanks
|
|
|
|
 |
stixx
|
Post subject: Re: SabNZBd post-processing script for separating downloads Posted: January 12th, 2014, 12:11 am |
|
 |
Flash Video |
Joined: September 19th, 2010, 9:48 am Posts: 20
|
Pete wrote: You need quotes around "E:\Recorded TV". Thanks. I will give that a try
|
|
|
|
 |
stixx
|
Post subject: Re: SabNZBd post-processing script for separating downloads Posted: January 13th, 2014, 11:56 am |
|
 |
Flash Video |
Joined: September 19th, 2010, 9:48 am Posts: 20
|
Pete wrote: You need quotes around "E:\Recorded TV". Yep - that worked. Thanks again!
|
|
|
|
 |
|
|