Alt.Binz (English) > Help

Alt.binz Scripts - The Code!

<< < (2/8) > >>

boredazfcuk:
Here's mine:

Needs to have the download and unrar folders passed to it e.g. D:\Documents\RSS\TidyUp.bat "$d" "$u"

It logs all folders that it unrars to and creates a shortcut to the log on the desktop to let me know something has been downloaded. It then uses a freeware utility (Bulk Rename Command http://www.bulkrenameutility.co.uk/Download.php) to rename the downloaded file e.g. show1.s01e01.720p.x264.aac20.releasegroup.mkv becomes "Show 1 S01E01.mkv"
It then removes the download folder and quits.



--- Code: ---set logfile=D:\Documents\RSS\dllog.txt
if not exist %logfile% echo Alt.Binz Download Log > %logfile%
date /t >> %logfile%
echo New file in %2 >> %logfile%
echo. >> %logfile%
copy /y "D:\Documents\RSS\RSS.lnk" %USERPROFILE%\Desktop

if (%2) == ("D:\Video\TV Shows\Show 1\Season 1") GOTO SHOW1
if (%2) == ("D:\Video\TV Shows\Show 2\Season 2") GOTO SHOW2
if (%2) == ("D:\Video\TV Shows\Show 2\Season 2") GOTO SHOW3
GOTO EXIT

:SHOW1
D:\Documents\RSS\brc64.exe /DIR:%2 /PATTERN:*.*.* /REMOVEWORDS:720 /REMOVEWORDS:264 /REMOVEWORDS:2HD /STRIPSYMBOLS /REMOVEWORDS:DD51 /REMOVEWORDS:AAC20 /STRIPCHARS /INSERT:"Show 1":1 /INSERT:" ":7 /INSERT:S:8 /INSERT:E:11 /TRIM /EXECUTE
GOTO END

:SHOW2
D:\Documents\RSS\brc64.exe /DIR:%2 /PATTERN:*.*.mkv /REMOVEWORDS:720 /REMOVEWORDS:264 /REMOVEWORDS:2HD /STRIPSYMBOLS /REMOVEWORDS:DD51 /REMOVEWORDS:AAC20 /STRIPCHARS /INSERT:"Show 2":1 /INSERT:" ":7 /INSERT:S:8 /INSERT:E:11 /TRIM /EXECUTE
GOTO END

:SHOW3
D:\Documents\RSS\brc64.exe /DIR:%2 /PATTERN:*.*.avi /REMOVEWORDS:720 /REMOVEWORDS:264 /REMOVEWORDS:2HD /STRIPSYMBOLS /REMOVEWORDS:DD51 /REMOVEWORDS:AAC20 /STRIPCHARS /INSERT:"Show 3":1 /INSERT:" ":7 /INSERT:S:8 /INSERT:E:11 /TRIM /EXECUTE
GOTO END

:END
rd /s /q %1

:EXIT


--- End code ---

simmc:
i like my movies to move from the unrar dir to the movies dir. i do this using the avi's file size.
if any avi's file size > 650mg then move it to the movies dir.


--- Code: ---for %%a in ("C:\Users\Me\Downloads\*.avi") do (if %%~za GTR 681574400 move "%%a" Movies)

--- End code ---

musictrivianut:
Okay, so I finally have my batch file about 90% of where I want it to be, but until I learn how to read media stream information on the command line, it's going to have to do.

I like watching 720p television episodes through my PS3 on my 50" Kuro plasma.  However, most all of them are uploaded in an mkv container.  For the last couple of weeks, just since I got my connection back and upgraded to watching the 720p episodes over the regular ones, I have been downloading and converting them to m2ts format and renaming them manually.  The conversion allows me to serve them using PS3 Media Server without any transcoding and the renaming bit, well, that's just a quirk of mine.  I dislike the long file names with all of the extra info.

I got tired of doing it all the long way and one of the purposes of having a computer is to make life easier, isn't it?  So, I delved into writing batch files to automate everything.  I had done a little bit before, but nothing on the scale that I ended up using; this was definitely a learning experience.  What I came up with probably isn't the best way to do it, but it works for my setup.  I was having problems with altbinz passing the download directory and collection name, so I ended up just setting the directory in a variable, since that never changes, and writing a routine to read the name of the file, since the collection name doesn't always match the name of the file.

Currently, I think the only issue may be with the creation of the meta file used by tsMuxeR for the conversion.  I'm using a generic file, written each time for each different file downloaded.  It won't always work, since some files may be encoded using DTS and I don't really want it to take that and convert it to AC3, but as I mentioned before, I don't yet know how to read the encoding information from the command line to tailor the meta file, so it will have to do for now.

If anybody has any suggestions, I am always looking to improve my coding skills.  I tried to put enough remarks in the file to explain what each section is doing, but I'll answer questions, also.

Oh yeah, my thanks to boredazfcuk for pointing out that Bulk Rename Utility has a command line version.  I've been using the GUI for a long time and love it, but didn't know about BRC.

Update: Okay, so I found a pre-compiled command-line version of MediaInfo for Windows and have figured out how to read the information the I need out of it (well, most of it, anyhow).  So, I have updated my batch file.  Reading the encoding information comes in handy to determine the frame rate.  Not all of the files I am trying to convert have the same frame rate and, for some reason, leaving it blank and having tsMuxeR read it from the stream didn't always work either.  So, the batch file now determines the frame rate using MediaInfo and writes it to the meta file (as well as the audio encoding scheme, DTS or AC3).  I also discovered that not all of the video files have the video stream as track 1 and the audio as track 2; sometimes they are reversed.  That led to the other major change - if the first attempt fails, it swaps the track numbers in the meta file and running a second attempt at conversion.

I think that covers most everything that I updated.  I am incredibly satisfied with the file the way it works now.  I have tested it with a good dozen files with varying frame rates and mixed track numbers and it has yet to choke on one.  There is nothing else I can think to do to improve it, so I think I'm done for now.

And while I didn't get any comments or questions after posting it the first time, those are still welcome.

Update 2:  Turns out I left out a rather important line of code, the one that runs tsMuxeR the second time if the first attempt fails.  Should work now.

Final update (hopefully):  After much research, I finally figured out how to parse a text file and read the information passed from mediainfo.  The program now reads the frame rate and video and audio tracks from the file and sets variables for use in the meta file for muxing.  I've also discovered that the PS3 will not pass a DTS stream unless it is from an optical disc, so I also added routines to check for a DTS audio track, demux it, convert it to AC3 format and then mux the video and audio into a new file.  I've been using the new batch file for a couple of days now and it hasn't choked on any of the mkv files I've thrown at it, so I think it's done (finally).

Hope that someone else out there can make use of it, but I have to say, learning how to do all of this has really helped my batch writing skills (I've learned a lot that I did not know before).


--- Code: ---@echo off
setlocal ENABLEEXTENSIONS

rem this batch file converts a downloaded file from an mkv container to m2ts
rem it uses mediainfo command line interface to read video and audio track numbers
rem tsmuxer to demux dts tracks and remux files to m2ts format and
rem eac3to to convert dts tracks to ac3 format

rem set the download directory and change to it

set dldir=C:\temp
cd %dldir%

rem if the file did not unrar correctly, the next command will quit the program

if not exist %dldir%\*.mkv goto :eof

rem the next set of commands finds the name of the file that was downloaded
rem (there should only be one mkv file in the directory)
rem Bulk Rename line that follows will remove spaces from the target filename

"C:\Program Files\brc_64\brc64.exe" /DIR:%dldir% /PATTERN:"*.mkv" /CHANGECASE:L /REPLACECI:" ":.  /TRIM /QUIET /EXECUTE

for /f "delims=" %%A in ('forfiles /m *.mkv /c "cmd /c echo @fname"') do set filename=%%A
set filename=%filename:"=%

rem set the remaining variables

set muxdir=C:\Program Files (x86)\tsMuxeR
set eacdir=C:\Program Files (x86)\eac3to
set metafile=%dldir%\%filename%.meta
set media=%dldir%\%filename%.mediainfo.txt
set newmedia=%dldir%\%filename%.media.new.txt

rem need to determine which track is video and which is audio, since they are not
rem always consistent.  if the settings are not correct, tsmuxer will fail

c:\mediainfo.cli\mediainfo --Inform %filename%.mkv > %media%

find /i "id " %media% > %newmedia%

rem mediainfo always writes the video track information first, so the first ID will
rem always be that one.  setting a counter will let us skip over the video lines to
rem find the audio track number.  not interested in anything after that.

set line=1

for /f "tokens=1,2 delims=:" %%G in (%newmedia%) do (
set /a line+=1
if "%%G"=="ID                               " (
   set videotrack=%%H
   goto :findaudio)
)

:findaudio

set videotrack=%videotrack: =%
set /a line+=1

for /f "tokens=1,2 delims=: skip=%line%" %%G in (%newmedia%) do (
set /a line+=1
if "%%G"=="ID                               " (
   set audiotrack=%%H
   goto :setframes)
)

:setframes

set audiotrack=%audiotrack: =%

for /f "tokens=1,2 delims=:" %%G in (%media%) do (
if "%%G"=="Frame rate                       " set frames=%%H
)

set frames=%frames:fps=%
set frames=%frames: =%

:checkdts

findstr /I dts %media%
if not errorlevel 1 (goto :dts) else (goto :writemeta)

:dts

rem write meta file demuxing dts track
echo MUXOPT --no-pcr-on-video-pid --new-audio-pes --demux --vbv-len=500 > %metafile%
echo A_DTS, "%dldir%\%filename%.mkv", track=%audiotrack% >> %metafile%

rem demux audio
"%muxdir%\tsMuxeR.exe" "%metafile%" %dldir%

rem get name of dts file
for /f "delims=" %%A in ('forfiles /m *.dts /c "cmd /c echo @fname"') do set dtsfile=%%A
set dtsfile=%dtsfile:"=%

rem check for demuxing error
if not exist %dtsfile%.dts goto :failed
for /f %%A in ("%dldir%\%dtsfile%.dts") do set size=%%~zA
if %size%==0 goto :failed

rem convert dts to ac3
"%eacdir%\eac3to.exe" %dtsfile%.dts %dtsfile%.ac3 -640

rem write new meta file for m2ts container
echo MUXOPT --no-pcr-on-video-pid --new-audio-pes --vbv-len=500 > %metafile%
echo V_MPEG4/ISO/AVC, "%dldir%\%filename%.mkv", insertSEI, contSPS, fps=%frames%, track=%videotrack% >> %metafile%
echo A_AC3, "%dldir%\%dtsfile%.ac3" >> %metafile%

goto :mux

:writemeta

echo MUXOPT --no-pcr-on-video-pid --new-audio-pes --vbv-len=500 > %metafile%
echo V_MPEG4/ISO/AVC, %dldir%\%filename%.mkv, insertSEI, contSPS, fps=%frames%, track=%videotrack% >> %metafile%
echo A_AC3, %dldir%\%filename%.mkv, track=%audiotrack% >> %metafile%

:mux

"%muxdir%\tsMuxeR.exe" %metafile% %dldir%\%filename%.m2ts

rem if conversion was successful, delete downloaded file and clean up
rem otherwise, note the failure, clean up and quit

if not exist %filename%.m2ts goto :failed
for /f %%A IN ("%filename%.m2ts") do set size=%%~zA
if %size%==0 goto :failed

rem remove downloaded file, leaving converted file

del %dldir%\%filename%.mkv

goto :end

:failed

rem delete the failed conversion file and rename the downloaded file to note failure

del %dldir%\%filename%.m2ts
ren %dldir%\%filename%.mkv %filename%.conversion.failed.mkv

:end

rem rename new file to standard format that I prefer

"C:\Program Files\brc_64\brc64.exe" /DIR:%dldir% /PATTERN:"*.m2ts *.avi" /CHANGECASE:L /REPLACECI:s01e:1 /REPLACECI:_:. /REPLACECI:s02e:2 /REPLACECI:s03e:3 /REPLACECI:s04e:4 /REPLACECI:S05E:5 /REPLACECI:s06e:6 /REPLACECI:s07e:7 /REPLACECI:s08e:8 /REPLACECI:s09e:9 /REPLACECI:s10e:10 /REMOVEWORDS:".720p .dvdrip .hddvd .internal .repack .x264 .ws .pdtv .dsr .xvid .hdtv .dts .us .bluray .2010 -hv -runner aaf- -reptile -saints -sfm -2hd -fqm -sys -bajskorv -lol -bia -dimension -orenji -ctu -sitv -immerse -aaf -momentum -fov -ositv -gothic -cinefile" /TRIM /QUIET /EXECUTE

rem move the converted file to a new directory and clean up other files
rem if the conversion fails for some reason, this will still move the file into
rem the new directory, instead of deleting it

move %dldir%\*.m2ts %dldir%\done
move %dldir%\*.mkv %dldir%\done
move %dldir%\*.avi %dldir%\done
del %metafile%
del %media%
del %newmedia%
del %dtsfile%.dts
del %dtsfile%.ac3
del %dtsfile%*.txt
del *.idx
del %dldir%\*.nfo
del %dldir%\*.srr
del %dldir%\*.srs
del %dldir%\*.sfv
del %dldir%\*.nfo

endlocal
--- End code ---

musictrivianut:
Update on the code that I posted (above).

After running into multiple problems with files that folks uploaded (header compression, audio streams that went from 6 to 2 channels and back, audio streams in AAC format, etc), I decided to do some research into solving those and have resolved some other issues as well.  For some reason that I'm still trying to figure out, the command-line version of BRC will sometimes choke on a file and just quit with a runtime error.  Closing that dialog box will let the program continue to run, but if left unattended, you can get multiple batch files going and that's not really good.  So, I included a routine to make sure that only one batch window runs at a time.  I also sometimes ran into the program trying to process a file that altbinz was still trying to unrar, so now it checks for that and waits until that is finished.

This batch program can be set up to run after every download or you can wait until everything is done and then run it once.  You will obviously have to cater it to your system (making changes to any directories and downloading the programs that are needed), but it definitely works for me.

As always, comments welcome and if you have any question on why I did something the way I did, please ask.  I'll do my best to remember where I found it and point you to it.


--- Code: ---@echo off
setlocal ENABLEEXTENSIONS

:: this batch file converts a downloaded file from an mkv container to m2ts
:: it uses mediainfo command line interface to read video and audio track numbers
:: tsmuxer to demux dts tracks and remux files to m2ts format
:: eac3to to convert dts tracks to ac3 format
:: besweet fixes ac3 streams that are mixed 2/6 channels

::check to see if batch program is already running

for /f "delims= " %%A in ('tasklist /V /FI "IMAGENAME eq cmd.exe" ^2^> NUL ^| find /I /C "C:\Windows\system32\cmd.exe"') do set windows=%%A
if %windows% == 2 goto :exit

:: set the download directory and change to it

set dldir=C:\temp
cd %dldir%

::set variables for program directories

set muxdir=C:\Program Files (x86)\tsMuxeR
set eacdir=C:\Program Files (x86)\eac3to
set mkvmerge=C:\Program Files (x86)\MKVtoolnix
set besweet=C:\Program Files (x86)\BeSweet
set brc=C:\Program Files\brc_64

:: if there are no mkv files, clean up and quit

if not exist %dldir%\*.mkv goto :end

:: Bulk Rename line that follows will remove spaces from all of the mkv files to be processed

"%brc%\brc64.exe" /DIR:%dldir% /PATTERN:"*.mkv" /CHANGECASE:L /REPLACECI:" ":.  /REPLACECI:_:. /TRIM /QUIET /EXECUTE

:start

:: the next command finds the name of the last mkv file alphabetically

for /f "delims=" %%A in ('forfiles /m *.mkv /c "cmd /c echo @fname"') do set filename=%%A
set filename=%filename:"=%

:: set remaining variables

set metafile=%dldir%\%filename%.meta
set media=%dldir%\%filename%.mediainfo.txt
set newmedia=%dldir%\%filename%.media.new.txt
set mkvinfo=%dldir%\%filename%.mkvinfo.txt
set audioformat=A_AC3

:dllcheck

:: check to see if altbinz is unraring a file
:: if it is, then the program waits because
:: if batch file tries to process the file being
:: uncompressed it will cause errors

Listdlls altbinz > %dldir%\dlls.txt

findstr /I unrar %dldir%\dlls.txt > nul
if not errorlevel 1 (goto :wait) else (goto :findvideo)

:wait

ping 127.0.0.1 -n 6 > nul
goto :dllcheck

:findvideo

:: need to determine which track is video and which is audio, since they are not
:: always consistent.  if the settings are not correct, tsmuxer will fail

c:\mediainfo.cli\mediainfo --Inform %filename%.mkv > %media%

find /i "id " %media% > %newmedia%

:: mediainfo always writes the video track information first, so the first ID will
:: always be that one.  setting a counter will let us skip over the video lines to
:: find the audio track number.  not interested in anything after that.

set line=1

for /f "tokens=1,2 delims=:" %%G in (%newmedia%) do (
set /a line+=1
if "%%G"=="ID                               " (
   set videotrack=%%H
   goto :findaudio)
)

:findaudio

set videotrack=%videotrack: =%
set /a line+=1

for /f "tokens=1,2 delims=: skip=%line%" %%G in (%newmedia%) do (
set /a line+=1
if "%%G"=="ID                               " (
   set audiotrack=%%H
   goto :audioformat)
)

:audioformat

set audiotrack=%audiotrack: =%

for /f "tokens=1,2 delims=: skip=%line%" %%G in (%newmedia%) do (
set /a line+=1
if "%%G"=="Codec ID                         " (
   set audioformat=%%H
   goto :setframes)
)

:setframes

set audioformat=%audioformat: =%

for /f "tokens=1,2 delims=:" %%G in (%media%) do (
if "%%G"=="Frame rate                       " set frames=%%H
)

set frames=%frames:fps=%
set frames=%frames: =%

:: check for header compression
:: if header is compressed, tsmuxer will fail

"%mkvmerge%\mkvinfo.exe" %filename%.mkv > %mkvinfo%
findstr /i "header removal" %mkvinfo%
if not errorlevel 1 (goto :fixstream) else (goto :checkdts)

:fixstream

:: this simply tries to remux the file with no header compression

"%mkvmerge%\mkvmerge.exe" -o "%dldir%\%filename%.fixed.mkv" --default-track 0:yes --forced-track 0:no --compression 0:none --default-track 1:yes --forced-track 1:no --compression 1:none -S -T --no-global-tags --no-chapters "%dldir%\%filename%.mkv"

:: if remuxing with no compression fails, then the audio stream is probably
:: a mixture of 2 and 6 channels, so fix that

if not errorlevel 0 (goto :fixac3)

del %dldir%\%filename%.mkv
set filename=%filename%.fixed

:: AC3 is preferable to DTS, so convert that

:checkdts

findstr /I dts %media%
if not errorlevel 1 (goto :dts) else (goto :writemeta)

:dts

:: write meta file demuxing dts track

echo MUXOPT --no-pcr-on-video-pid --new-audio-pes --demux --vbv-len=500 > %metafile%
echo A_DTS, "%dldir%\%filename%.mkv", track=%audiotrack% >> %metafile%

:: demux audio

"%muxdir%\tsMuxeR.exe" "%metafile%" %dldir%

:: get name of dts file

for /f "delims=" %%A in ('forfiles /m *.dts /c "cmd /c echo @fname"') do set dtsfile=%%A
set dtsfile=%dtsfile:"=%

:: check for demuxing error

if not exist %dtsfile%.dts goto :failed
for /f %%A in ("%dldir%\%dtsfile%.dts") do set size=%%~zA
if %size%==0 goto :failed

:: convert dts to ac3

"%eacdir%\eac3to.exe" %dtsfile%.dts %dtsfile%.ac3 -640

:: write new meta file for m2ts container

echo MUXOPT --no-pcr-on-video-pid --new-audio-pes --vbv-len=500 > %metafile%
echo V_MPEG4/ISO/AVC, "%dldir%\%filename%.mkv", insertSEI, contSPS, fps=%frames%, track=%videotrack% >> %metafile%
echo A_AC3, "%dldir%\%dtsfile%.ac3" >> %metafile%

goto :mux

:writemeta

echo MUXOPT --no-pcr-on-video-pid --new-audio-pes --vbv-len=500 > %metafile%
echo V_MPEG4/ISO/AVC, %dldir%\%filename%.mkv, insertSEI, contSPS, fps=%frames%, track=%videotrack% >> %metafile%
echo %audioformat%, %dldir%\%filename%.mkv, track=%audiotrack% >> %metafile%

:mux

"%muxdir%\tsMuxeR.exe" %metafile% %dldir%\%filename%.m2ts

:: if conversion was successful, delete downloaded file and clean up
:: otherwise, note the failure, clean up and quit

if not errorlevel 0 goto :fixac3

if not exist %filename%.m2ts goto :failed
for /f %%A IN ("%filename%.m2ts") do set size=%%~zA
if %size%==0 goto :failed

:: remove downloaded file, leaving converted file

del %dldir%\%filename%.mkv

goto :end

:fixac3

:: sometimes the ac3 file will have both 2 channels and 5.1 channels
:: this routine will correct that and leave a 2 channel ac3 file
:: and will then remux both video and audio into an m2ts container

if %audiotrack%=="2" (
"%mkvmerge%\mkvextract.exe" --ui-language en tracks "%dldir%\%filename%.mkv" 0:"%dldir%\%filename%.video.h264" 1:"%dldir%\%filename%.audio.ac3"
)
else (
"%mkvmerge%\mkvextract.exe" --ui-language en tracks "%dldir%\%filename%.mkv" 0:"%dldir%\%filename%.audio.ac3" 1:"%dldir%\%filename%.video.h264"
)
"%besweet%\BeSweet.exe" -core( -input "%dldir%\%filename%.audio.ac3" -output "%dldir%\%filename%.audio.fixed.ac3" -logfilea "%besweet%\BeSweet.log" ) -azid( -s stereo -g 1 ) -ac3enc( -b 384 ) -profile( ~~~~~ Default Profile ~~~~~ )

echo MUXOPT --no-pcr-on-video-pid --new-audio-pes --vbv-len=500 > %metafile%
echo V_MPEG4/ISO/AVC, %dldir%\%filename%.video.h264, insertSEI, contSPS, fps=%frames%, track=%videotrack% >> %metafile%
echo A_AC3, %dldir%\%filename%.audio.fixed.ac3, track=%audiotrack% >> %metafile%

"%muxdir%\tsMuxeR.exe" %metafile% %dldir%\%filename%.m2ts

if not exist %filename%.m2ts goto :failed
for /f %%A IN ("%filename%.m2ts") do set size=%%~zA
if %size%==0 (goto :failed) else (
del %dldir%\%filename%.mkv
goto :end
)

:failed

:: delete the failed conversion file and rename the downloaded file to note failure

del %dldir%\%filename%.m2ts
ren %dldir%\%filename%.mkv %filename%.conversion.failed.mkv

:end

:: rename new file to standard format that I prefer

"C:\Program Files\brc_64\brc64.exe" /DIR:%dldir% /PATTERN:"*.m2ts *.avi *.mp4" /CHANGECASE:L /REPLACECI:s01e:1 /REPLACECI:_:. /REPLACECI:s02e:2 /REPLACECI:s03e:3 /REPLACECI:s04e:4 /REPLACECI:S05E:5 /REPLACECI:s06e:6 /REPLACECI:s07e:7 /REPLACECI:s08e:8 /REPLACECI:s09e:9 /REPLACECI:s10e:10 /REPLACECI:s11e:11 /REPLACECI:s12e:12 /REPLACECI:s13e:13 /REPLACECI:s15e:15 /REPLACECI:s16e:16 /REPLACECI:s17e:17 /REPLACECI:s18e:18 /REMOVEWORDS:".720p .dvdrip .hddvd .internal .hr .repack .2009 .2010 .2011 .divx .x264 .hdrip .h.264 .web-dl .ws .real .pdtv .dsr .xvid .eng .saints .hdtv .webrip .dvd5 .dvd9 .dd5.1 .dts5.1 .dts .sub .us .fixed .bluray .track1 .2010 _track1 infinite- tpz- aaf- avchd- halcyon- runner- -etp -lmao -wide -ffndvd -t00ng0d -dvdrip -shortbrehd -omicron -gnarly -phase -nmbstv -nodlabs -diverge -river -paramount -transience -tns -haggis -w4f -xvid -nbs -premier -hoodbag -dah -qcf -dirty -hv -crimson -dbo -angelic -blind -ftp -ingot -spunx -ebp -runner -xii -shotv -reward -sinners -rpk -unit3d -reptile -dhd -saints -fty -macro -sfm -2hd -fqm -sys -bajskorv -lol -tla -compulsion -p0w4 -yestv -avs -bia -dimension -orenji -ctu -sitv -immerse -aaf -sprinter -momentum -fov -ositv -gothic -ctrlhd -cinefile" /TRIM /QUIET /EXECUTE

:: move the converted file to a new directory and clean up other files
:: if the conversion fails for some reason, this will still move the file into
:: the new directory, instead of deleting it

move %dldir%\*.m2ts %dldir%\done
move %dldir%\*.failed.mkv %dldir%\done
move %dldir%\*.avi %dldir%\done
move %dldir%\*.mp4 %dldir%\done
del %metafile%
del %media%
del %newmedia%
del %mkvinfo%
del *.dts
del *.ac3
del *.h264
del %dtsfile%*.txt
del %dldir%\dlls.txt
del %dldir%\*.idx
del %dldir%\*.nfo
del %dldir%\*.srr
del %dldir%\*.srs
del %dldir%\*.sfv

if exist %dldir%\*.mkv goto :start

:exit

endlocal

--- End code ---

domdom:
Guys,

I need some help here. Some of the filenames are sometimes obfuscated and after unrar, I would like to just rename it with the collection name, which is usually the filename un-obfuscated  8)

It must be quite easy but variables for filename and collection  name are needed!  :( what are they?
and then just issue some command like rename %filename %collection_name or something?

Sorry I feel like a noob here, any hint would be cool thanks

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version