Come up with a useful post-processing script? Share it here!
doubledrat
Release Testers
Posts: 180 Joined: February 20th, 2008, 3:16 pm
Post
by doubledrat » May 18th, 2009, 11:02 am
Eejit wrote:
Change
Code: Select all
IF EXIST "%dirname%\video_ts" CALL makeISO
to
Code: Select all
IF EXIST "%dirname%\video_ts" GOTO makeISO
Should work then
sorry, should have been
(I did say it wasn't tested
)
using CALL will return when it encounters GOTO :EOF whereas GOTO doesn't. this is not important until you start having multiple operations but is a good habit to get into so that when you expand your scripts they work as expected e.g. (the GOTO :EOF after the calls exits the script)
Code: Select all
IF something CALL :makeISO
IF somethingelse CALL :makeIpod
CALL :tidyup
GOTO :EOF
:makeIpod
blah blah
GOTO :EOF
:makeISO
blah blah
GOTO :EOF
:tidyup
blah blah
GOTO :EOF
Last edited by
doubledrat on May 18th, 2009, 11:16 am, edited 1 time in total.
doubledrat
Release Testers
Posts: 180 Joined: February 20th, 2008, 3:16 pm
Post
by doubledrat » May 18th, 2009, 11:07 am
shanghei wrote:
You know what would also be usefull, a command to delete the folder with the video_ts folder after it has created an iso.
Anyone know the command for that?
you need to be sure the iso creation was successful. to do this you use the
syntax on your imgburn command. this means that only on success of the preceding command will it execute. e.g.
Code: Select all
"C:\Program Files\ImgBurn\ImgBurn.exe" /MODE BUILD /BUILDMODE IMAGEFILE /SRC "%dirname%\video_ts" /DEST "C:\somewhere\%name%.ISO" /START /CLOSE && rmdir /s "%dirname%"
I accept no responsibility for what gets deleted by this snippet
shanghei
Newbie
Posts: 8 Joined: May 17th, 2009, 1:55 am
Post
by shanghei » May 18th, 2009, 12:27 pm
doubledrat wrote:
shanghei wrote:
You know what would also be usefull, a command to delete the folder with the video_ts folder after it has created an iso.
Anyone know the command for that?
you need to be sure the iso creation was successful. to do this you use the
syntax on your imgburn command. this means that only on success of the preceding command will it execute. e.g.
Code: Select all
"C:\Program Files\ImgBurn\ImgBurn.exe" /MODE BUILD /BUILDMODE IMAGEFILE /SRC "%dirname%\video_ts" /DEST "C:\somewhere\%name%.ISO" /START /CLOSE && rmdir /s "%dirname%"
I accept no responsibility for what gets deleted by this snippet
I added that line to the script and the script just hangs in sabnzbd after the image is created. When I ran the code manually in command prompt i.e:
"C:\Program Files\ImgBurn\ImgBurn.exe" /MODE BUILD /BUILDMODE IMAGEFILE /NOIMAGEDETAILS /VOLUMELABEL "test" /SRC "D:\downloads\Movies\American Time Capsule (1968)\video_ts" /DEST "D:\downloads\movies\test.ISO" /START /CLOSE && rmdir /s "D:\downloads\Movies\American Time Capsule (1968)"
It asked me if I was sure I wanted to delete the dir and I had to either type y or n.
I am assuming thats why the script hangs in sabnzbd.
Any way to fix this?
doubledrat
Release Testers
Posts: 180 Joined: February 20th, 2008, 3:16 pm
Post
by doubledrat » May 18th, 2009, 2:48 pm
sorry yes, use
q means quiet i.e. no prompting
shanghei
Newbie
Posts: 8 Joined: May 17th, 2009, 1:55 am
Post
by shanghei » May 18th, 2009, 2:58 pm
I tried the /q /s and it deletes the folder before imgburn even opens :/
shanghei
Newbie
Posts: 8 Joined: May 17th, 2009, 1:55 am
Post
by shanghei » May 18th, 2009, 8:39 pm
Nevermind, I found if I put /DELETESOURCE in the script it deletes it.
Thanks!
Nefarious
Release Testers
Posts: 28 Joined: March 5th, 2009, 12:15 pm
Post
by Nefarious » June 16th, 2009, 1:11 pm
shanghei wrote:
Nevermind, I found if I put /DELETESOURCE in the script it deletes it.
Thanks!
Can you post the full code including the delete source?
-BK-
Newbie
Posts: 4 Joined: November 23rd, 2009, 2:18 am
Post
by -BK- » November 23rd, 2009, 5:44 am
Can you post the full code including the delete source?
Anyone, please?
And... as a n00b, how do I 'insert' this script in SABnzbd+ 0.5.0.b1?
Last edited by
-BK- on December 2nd, 2009, 3:43 am, edited 1 time in total.
-BK-
Newbie
Posts: 4 Joined: November 23rd, 2009, 2:18 am
Post
by -BK- » December 6th, 2009, 1:12 pm
So I guess the code should be something like this:
"C:\Program Files\ImgBurn\ImgBurn.exe" /MODE BUILD /BUILDMODE IMAGEFILE /NOIMAGEDETAILS /DELETESOURCE /VOLUMELABEL "%name%" /SRC "%dirname%\video_ts" /DEST "D:\somewhere\%name%.ISO" /START /CLOSE && rmdir /s "%dirname%"
Now how and where to enter it in SABnzbd+ 0.5.0b1 as a 'script'?
Someone?
doubledrat
Release Testers
Posts: 180 Joined: February 20th, 2008, 3:16 pm
Post
by doubledrat » December 8th, 2009, 4:46 am
yes, but I wouldn't do the delete until you're sure you have it right!
and you need much more than just that one line you realise?
you create a batch file as described and then configure sab to run it as a postprocessing job. this is documented in the SAB literature and is easy, so I won't go over it again.
seanseymour
Newbie
Posts: 2 Joined: September 20th, 2009, 5:44 pm
Post
by seanseymour » December 10th, 2009, 4:26 pm
Nefarious wrote:
shanghei wrote:
Nevermind, I found if I put /DELETESOURCE in the script it deletes it.
Thanks!
Can you post the full code including the delete source?
DISCLAIMER: I'm not using this.
Code: Select all
set dirname=%1
set dirname=%dirname:"=%
set name=%3
set name=%name:"=%
set nbID=%4
set DLTYPE=%5
IF EXIST "%dirname%\video_ts" GOTO makeISO
GOTO :EOF
:makeISO
"C:\Program Files\ImgBurn\ImgBurn.exe" /DELETESOURCE /MODE BUILD /BUILDMODE IMAGEFILE /NOIMAGEDETAILS /VOLUMELABEL "%name%" /SRC "%dirname%\video_ts" /DEST "D:\downloads\movies\%name%.ISO" /START /CLOSE
GOTO :EOF
-BK-
Newbie
Posts: 4 Joined: November 23rd, 2009, 2:18 am
Post
by -BK- » December 11th, 2009, 12:15 am
Thanks, I'll give it a try!
doubledrat
Release Testers
Posts: 180 Joined: February 20th, 2008, 3:16 pm
Post
by doubledrat » December 11th, 2009, 4:17 am
shanghei wrote:
I tried the /q /s and it deletes the folder before imgburn even opens :/
as someone else is now looking to do this, I should answer this. it seems that imgburn is returning a completed status on opening it's window rather than at the end of the process. I use it to burn discs and it doesn't return until it's finished, so I don't know if it does something odd when creating an ISO. until you're certain it's doing what you want, I would avoid doing the delete, just do an echo of the delete command until you're happy e.g.
&& echo rmdir /s/q "%dirname%"
when you're happy the process works, remove the "echo"
morre95
Jr. Member
Posts: 63 Joined: February 21st, 2010, 7:17 am
Post
by morre95 » March 9th, 2010, 8:49 am
I made my one version of this in Python. Because i needed it to handle mutiple video_ts folder. Here it is:
http://pastebin.com/c9a3Bysb
randyharris
Full Member
Posts: 146 Joined: January 21st, 2010, 5:36 pm
Post
by randyharris » March 26th, 2010, 1:11 pm
seanseymour wrote:
Nefarious wrote:
shanghei wrote:
Nevermind, I found if I put /DELETESOURCE in the script it deletes it.
Thanks!
Can you post the full code including the delete source?
DISCLAIMER: I'm not using this.
Code: Select all
set dirname=%1
set dirname=%dirname:"=%
set name=%3
set name=%name:"=%
set nbID=%4
set DLTYPE=%5
IF EXIST "%dirname%\video_ts" GOTO makeISO
GOTO :EOF
:makeISO
"C:\Program Files\ImgBurn\ImgBurn.exe" /DELETESOURCE /MODE BUILD /BUILDMODE IMAGEFILE /NOIMAGEDETAILS /VOLUMELABEL "%name%" /SRC "%dirname%\video_ts" /DEST "D:\downloads\movies\%name%.ISO" /START /CLOSE
GOTO :EOF
Nice work!
I'm going to add this to a Windows Movie script I'm making for a friend.