Alt.Binz (English) > Help

Alt.binz Scripts - The Code!

(1/8) > >>

Hecks:
Since version 0.26.1, Alt.binz includes an Execute Command feature that runs after PAR2 checking, repairing or unraring is complete (whichever is last in the cycle).  Usage as follows:


--- Quote from: Rdl ---There is a default execute command under setup->NZB #2, but command can be specified separately for any collection.

Format for command is:
full_path_to_exe_bat_or_whatever "parameters"

Use $d for full download path without a trailing delimiter
Use $u for full unrar path without a trailing delimiter

Examples:

c:\util\MyCleanupRoutine.exe "-a $d"
c:\util\CleanupAfterUnrar.bat "$d $u"


--- End quote ---


Post any scripts you've written in this thread, with brief info about usage, command parameters, and so on.

:)

-Hecks

Hecks:
Here's a little sample batch script (using cmd.exe) to get us started:

Description:
Logs all new files in download and unrar directories with date/time stamps.

Usage:
Copy the code, open Notepad, paste and save the file in your Altbinz directory (or anywhere else) as  "logdownloads.bat" (*with* quotation marks).

Command:
c:\program files\altbinz\logdownloads.bat "$d $u"


--- Code: ---@echo off

:set_logfile
set logfile=C:\dldlog.txt
if not exist %logfile% echo Alt.binz Download Log > %logfile%

:set_folders
set dldir=%1
set undir=%2

:check_folders
if exist %dldir% for %%f in (%dldir%\*.*) do (call :log_files "%%f")
if exist %undir% for %%f in (%undir%\*.*) do (call :log_files "%%f")
goto :eof

:log_files
find /I "%~nx1" "%logfile%" >nul
if %ERRORLEVEL%==0 goto :eof
for /f "tokens=*" %%t in ('time /t') do (set timet=%%t)
echo %DATE% %TIMET% %~dpnx1 >> %logfile%
goto :eof


--- End code ---

-Hecks

davidq666:
a small script made by cr4zyfr4g, that was posted in the request-forum:

Description:

Checks for split files joins them either into download or unrar-dir and deletes all split files afterwards

Usage:
Copy the code, open Notepad, paste and save the file in your Altbinz directory (or anywhere else) as  "join.bat" (*with* quotation marks).

Command:
path-to-bat\join.bat "$d" for joining in download-dir
path-to-bat\join.bat "$d" "$u" for joining in unrar-dir


--- Code: ---@ECHO OFF

if exist "%1\*.001" (
TITLE joining
set d=%1
set u=%2
if "%2"=="" set u=%1
if not exist "%2" (
md %2
)
for /f %%a in ('dir /b %1\*.001') do (
call :SUB %%a
)
Echo joined!
pause
)

goto :eof

:sub
copy /b "%d%\%~n1.*" "%u%\_%~n1"
del "%d%\%~n1.*" > nul
goto :eof
--- End code ---

MrbLOB9000:
figured out a script that will unzip split 7zip, can be found here

Description:

Uses the app 7zip to unzips 7zip files to the set unrar location.

Afterwards

* nfo
* jpg
* png
* wmv
* avi
* mpg
* mpeg
* mkv
are moved to unrar dir

and

* par2
* 7zip
* sfv
are deleted.

If the download-folder is left empty it gets deleted as well.

Usage:
Copy the code, open Notepad, paste and save the file in your Altbinz directory (or anywhere else) as  "7zip.bat" (*with* quotation marks).

Command:
path-to-bat\7zip.bat "$d" "$u"


--- Code: ---rem in nzb#2 put this for default execution command: C:\folder\7zip.bat "$d" "$u"
If exist %1\*.7z.001 GOTO Contains7z
If exist %1\*.7z GOTO Contains7z

GOTO notempty

:Contains7z
FOR %%F IN (%1\*.7z.001) DO "C:\Program Files\7-Zip\7z.exe" x -o%2 "%%F"
IF ERRORLEVEL 1 GOTO Failed

FOR %%F IN (%1\*.7z) DO "C:\Program Files\7-Zip\7z.exe" x -o%2 "%%F"
IF ERRORLEVEL 1 GOTO Failed

move %1\*.nfo %2
move %1\*.jpg %2
move %1\*.png %2
move %1\*.wmv %2
move %1\*.avi %2
move %1\*.mpg %2
move %1\*.mpeg %2
move %1\*.mkv %2

del %1\*.7z.*
del %1\*.7z
del %1\*.par2
del %1\*.sfv

rem @echo off
dir %1|find " 0 File(s)" > NUL
if errorlevel 1 goto notempty

dir %1| find " 2 Dir(s)" > NUL
if errorlevel 1 goto notempty

rd %1

:Failed
:notempty


--- End code ---

by adding or changing lines like:

move %1\*.nfo %2
or
del %1\*.sfv

u can easily adapt it to delete or move the types of files you would like...

P.S: The option to move files is different from the option "move to unrar folder" in settings->unrar!

The settings-option will only work if an unraring has taken place beforehand.
The script-option will work every time there is a par2-set.

davidq666:
Description:

deletes nfos, jpgs, pngs, sfvs and srr files and deletes the download dir afterwards if empty

Usage:
Copy the code, open Notepad, paste and save the file in your Altbinz directory (or anywhere else) as  "simple-clean-up.bat" (*with* quotation marks).

Command:
path-to-bat\simple-clean-up.bat "$d"


--- Code: ---del %1\*.nfo
del %1\*.jpg
del %1\*.png
del %1\*.sfv
del %1\*.srr
rd %1

--- End code ---

Navigation

[0] Message Index

[#] Next page

Go to full version