Unrar & unpar.

From your noodle to other noodles. Talk about ways to get the most from Hazel. Even exchange recipes for the cool rules you've thought up. DO NOT POST YOUR QUESTIONS HERE.

Moderators: Mr_Noodle, Moderators

Unrar & unpar. Sat Nov 24, 2007 7:30 pm • by joshkerr
I'd like to use Hazel to unrar and unpar files that I've downloaded. I'd like this to run automatically on a certain folder where the downloads are coming into. I'm not sure the best way to achieve this. Currently I have the following:

1. if kind is a folder, then run on subfolders
2. If extention is par2 and it doesn't have a + in it, then open with mac par deluxe

The problem I run into is that Unison is downloading into this folder and sometimes it will download the par2 file first and then the rest later. So hazel is constantly running mac par on it. I wish I could specify a time delay or something.

Does anyone else have a better workflow?
joshkerr
 
Posts: 4
Joined: Tue Feb 13, 2007 10:25 pm

Mon Nov 26, 2007 1:58 pm • by Mr_Noodle
Could you explain how the par2 stuff works? Is it something where a file is split up into multiple chunks? If so, it might be tricky since there's no way to tell when all parts are downloaded.

If you want to try to do a delay, you can use a script to pause. You can also try using Automator but it will only work on Leopard (on Tiger, Hazel will be unable to wait for the Automator workflow to finish).

I haven't used Unison but if it has some way to run a script when a certain download is complete, you may be able to rig some way of having it trigger Hazel in that way.
Mr_Noodle
Site Admin
 
Posts: 11195
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Mon Nov 26, 2007 4:58 pm • by joshkerr
When the files are downloaded, I end up with a directly that looks like this:

file.rar
file.r01
file.r02
file.r03
file.vol000+01.par2
file.vol000+02.par2
file.par2

If I launch file.par2 into Mac Par Deluxe, it will automatically run the par checking and then unrar the files and then delete all the extra stuff so that I will be left with just the uncompressed files.

The tricky part with Hazel is automating this process. Right now I'm doing the following:

Rule 1: if type if folder, run on subfolders.
Rule 2: if extension = par2 and filename does not contain a + sign and file is older than 20 minutes, then open in Mac Par Deluxe.

That seems to work okay because it takes approximately 20 minutes to download something from the newsgroups. I can always increase the amount to 1 hour if needed.

What I'd love to see is some kind of way to have Hazel know that the download is done and then process it.
joshkerr
 
Posts: 4
Joined: Tue Feb 13, 2007 10:25 pm

Wed Nov 28, 2007 3:48 pm • by Mr_Noodle
I think this would be tricky as you can't tell how many parts to wait for. I think only the downloading program would know that. If the downloading program has some sort of hook where you can execute a script, you can then do something like have it do something like color the par2 file a certain color that Hazel could pick up as a sign that it is done. Otherwise, not sure how else it could be done.
Mr_Noodle
Site Admin
 
Posts: 11195
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Mon Jan 07, 2008 5:23 am • by pczjrh
My solution to this is to just be a little patient.
I do the same thing, but I leave my unison downloads going overnight, so I use Hazel like this.

Set downloads folder to check for .nbz files and if the creation date is the same as todays date do nothing, if it is yesterdays date or older, open with Unision then delete the nbz.
Check the creation date of the .par2 file without + in the filename in the Unision dlownload folder. If the file is older than, say 2/3 hours, the open with MacParDeluxe, run rules of folder contents to deal with the extracted file.

You can also set split&Concat / MacPar to trash parts when they have finished with then, and Hazel will clean out the trash periodically.

Result: an overnight downloading session (starting just after midnight), nicely sorted and cleaned up in the morning ;-)

I hope it helps others out.
pczjrh
 
Posts: 1
Joined: Mon Jan 07, 2008 5:12 am

Re: Unrar & unpar. Wed Jun 09, 2010 9:32 pm • by smithjw
I am trying to do something similar to this. I have files downloaded in multiple parts

file.rar
file.r01
file.r02
etc

maybe you could set Hazel to only act on files which you manually label with a specific colour. I know that makes it more of a user task, but that way only files that are coded green for example are extracted.
DJ, Video Editor, & All round geek
smithjw
 
Posts: 9
Joined: Wed Jun 09, 2010 7:06 pm
Location: Melbourne, Australia


Return to Tips & Tricks - DO NOT POST QUESTIONS

cron