Newsunpack.py: the solution to the automatic par2 verifying and rar unpacking problem?

Wednesday, 25 October 2006

Finally, I have found a possible solution! Whilst searching on google, yet again, for a program that will automatically verify par2 files and extract rar files, I came across a program called “newsunpack”. It is written by someone named “Freddie”, who is clearly a highly competent python coder, have a look at the website “MadCowDisease“.
His program makes something like this possible, which I have not been able to do with hellanzb:


~$ ls ./*.par2 | while read par ; \
do /usr/local/bin/newsunpack.py -d "$par" ; done

Or something along those lines, this is just an example, I have not tested this command. But if newsunpack.py is in the specified path, and made executable, then I *think* that should verify/fix and extract all rar files with par2 recovery blocks (in the directory wherein it is executed) and deletes all the rar/par2 files afterwards.

In any case, this forms an excellent basis for a script so simple, even an idiot like myself will probably be able to write it without too many awful mistakes. Perhaps, if I manage to write it, I will post it here, for your entertainment. ;)

Advertisements

The problem with hellanzb and local processing

Wednesday, 25 October 2006

Well, in spite of my attempt to use hellanzb in a script to automate par2 verifying and unrar-ing of my usenet downloads, I have still found an insurmountable problem. Of course, hellanzb was never designed with this particular use in mind, so I suppose I should not be too surprised.

The problem is defined as follows. Whenever I invoke hellanzb on a directory to process, containing many different downloads, it will verify all the par2 recovery blocks just fine, as long as they are complete. If, however, it finds a problem with one of the par2 recovery blocks, then it just stops right there and does not move on. It also does not extract the downloads that it just verified as having complete data integrity. Not good.

It seems that hellanzb, being designed for directories containing only one download at a time, is also treating directories with many downloads as if it is dealing with a single download! So when it finds a broken par2 block, then why indeed move on? That does seem logical. So for the kind of local processing I have in mind, hellanzb would really need a new and improved method.

In the mean time, I am occasionally reading from the “Advanced Bash-Scripting Guide”, as I try to write a shell script that does a better job. And searching google of course, to make sure I’m not reinventing a wheel or anything. But so far, no luck.