Page 2 of 3

Re: Video_TS to ISO

Posted: May 18th, 2009, 11:02 am
by doubledrat
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

Code: Select all

CALL :makeISO
(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

Re: Video_TS to ISO

Posted: May 18th, 2009, 11:07 am
by doubledrat
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

Code: Select all

&& 
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  ;)

Re: Video_TS to ISO

Posted: May 18th, 2009, 12:27 pm
by shanghei
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

Code: Select all

&& 
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?

Re: Video_TS to ISO

Posted: May 18th, 2009, 2:48 pm
by doubledrat
sorry yes, use

Code: Select all

rmdir /q/s
q means quiet i.e. no prompting

Re: Video_TS to ISO

Posted: May 18th, 2009, 2:58 pm
by shanghei
I tried the /q /s and it deletes the folder before imgburn even opens :/

Re: Video_TS to ISO

Posted: May 18th, 2009, 8:39 pm
by shanghei
Nevermind, I found if I put /DELETESOURCE in the script it deletes it.

Thanks!

Re: Video_TS to ISO

Posted: June 16th, 2009, 1:11 pm
by Nefarious
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?

Re: Video_TS to ISO

Posted: November 23rd, 2009, 5:44 am
by -BK-
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?

Re: Video_TS to ISO

Posted: December 6th, 2009, 1:12 pm
by -BK-
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?  :'(

Re: Video_TS to ISO

Posted: December 8th, 2009, 4:46 am
by doubledrat
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.

Re: Video_TS to ISO

Posted: December 10th, 2009, 4:26 pm
by seanseymour
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

Re: Video_TS to ISO

Posted: December 11th, 2009, 12:15 am
by -BK-
Thanks, I'll give it a try!  ;D

Re: Video_TS to ISO

Posted: December 11th, 2009, 4:17 am
by doubledrat
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"

Re: Video_TS to ISO

Posted: March 9th, 2010, 8:49 am
by morre95
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

Re: Video_TS to ISO

Posted: March 26th, 2010, 1:11 pm
by randyharris
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.