New
#11
First download the plugin, I downloaded the version 1.3 not 1.3_CVS, not sure of the difference.
1. Next open Vuze, go to "Tools > Plugins > Installation Wizard".
2. Select "By File" and click next.
3. Browse to the downloaded plugin and select it then click next.
4. Installation Type is your choice.
5. Click Finish then Install then Close and Close again.
The plugin has been installed but I could only find how to use it by clicking on View in Vuze's menu bar and clicking Advanced List then I could right click a torrent under downloads, not libary or new, and find "Command Runner" just over half way down the context menu.
Hover over that and move to and select "Set on-completion command" then type in:
C:\UnRAR.bat "%D" "%N" "%F" %K
Replace C:\ with the location where you place the bat file, for example if you want it in your My Documents folder type in C:\Users\USERNAME\Documents\UnRAR.bat "%D" "%N" "%F" %K
To test the bat file from within Vuze I found the file could not be completed or "Command Runner" would not be on the context menu, so to test I added a torrent file for one that was complete but saved it to a different location, stopped the torrent in Vuze then copied the completed files to the new location then ran "Test on-completion command" from "Command Runner" on the context menu.
To test outside Vuze run it from the command promt or Start menu > Run (Win Key + R) with the required info,
eg. C:\UnRAR.bat "D:\Download\File Save location" "" "FILENAME" Single
eg. C:\UnRAR.bat "D:\Download\File Save location" "" "" Multi
The Display Name ("" in above commands) was used for multi but I changed it to use the filename instead but I left it in the bat file anyway.
BATCH FILE
The bat file is messy and probably over complicated, my batch skills are little. I've thrown in a few comments to try to help you understand in case you need to modify it in the future, they're the lines starting with REM.
I've tested it with single RAR torrents, multi RAR torrents ending with .rar, multi RAR torrents ending with .r01, r02, etc... and files/folders with spaces. Single and multi have different sections for extraction so if a single RAR is saved in a folder with other RAR's it should on process the new one, multi RAR's need their own folder or it may process the wrong RAR.
It also processes subfolders for torrents that contain RAR's inside a RAR. It appears to work ok but with subfolders it may try to extract every RAR for split RAR's but I think I prevented that. UnRAR is set not to overwrite files but if UnRAR stops to prompt for any other reason then the bat file will stall and you'll have to End Task for CMD and UnRAR in task manager as when run from Vuze it runs in the background hidden from the user.
I tried to test most scenarios but can't guarantee it will work for everything especially filenames with special characters.
Copy the following code into Notepad and save as UnRAR.bat. I hope you can understand everything and it works great. Let us know how you go.
If you download a torrent that has multiple individual RAR's not a split rar this will only extract one and rather than modify this, which would be difficult, I would use a seperate one.Code:@echo off REM Usage REM UnRAR.bat "%D" "%N" "%F" %K REM %D (%1) = Directory where files are saved REM %N (%2) = Display name of download REM %F (%3) = Name of downloaded file (For single file torrents) REM %K (%4) = Single/Multi set WINRAR="C:\Program Files\WinRAR\UnRAR" REM Strip quotes from %1, %2 and %3 to make it easier. set FOLDER=%1 set FOLDER=%FOLDER:~1,-1% set DISNAME=%2 set DISNAME=%DISNAME:~1,-1% set FILENAME=%3 set FILENAME=%FILENAME:~1,-1% REM Test if the directory where files are saved contains a RAR file if not exist "%FOLDER%\*.rar" exit if /i %4==Multi goto MULTI REM ------------------------------------------------- :Single REM Make a sub directory as filename.extracted REM and change the CMD prompt to it. mkdir "%FOLDER%\%FILENAME%.extracted" cd /d "%FOLDER%\%FILENAME%.extracted" %WINRAR% e -o- "%FOLDER%\%FILENAME%" goto SUBFOLDERS REM ------------------------------------------------- :MULTI REM For multi file torrent REM Get first RAR's filename REM Make a sub directory as filename.extracted and change the CMD prompt to it. for %%a in ("%FOLDER%\*.rar") do ( set "FILE=%%a" mkdir "%FOLDER%\%%~na.extracted" cd /d "%FOLDER%\%%~na.extracted" goto :DONE ) :DONE %WINRAR% e -o- "%FILE%" REM ------------------------------------------------- :SUBFOLDERS for /f "tokens=*" %%a in ('dir /b *.rar ^| find /i /v ".part"') do ( mkdir "%%a.extracted" cd "%%a.extracted" %WINRAR% e -o- "%%~fa" cd.. ) for /f "tokens=*" %%a in ('dir /b *.rar ^| find /i ".part01"') do ( mkdir "%%a.extracted" cd "%%a.extracted" %WINRAR% e -o- "%%~fa" cd.. ) for /f "tokens=*" %%a in ('dir /b /ad') do ( cd "%%a" call :SUBFOLDERS cd.. )
Last edited by Duzzy; 03 Jan 2013 at 09:55. Reason: Edited bat file