nznzb by Paul Hayter (2006)
===========================

Version: 0.20 (12.1.2007)

Quickstart
==========
nznzb is a utility for downloading multi-part binaries off usenet using NZB files. There is
only one option; one or more NZB files:

  nznzb something.nzb

You'll get some screen output (updated every 5 secs) indicating the total transferred, 
average transfer rate, time elapsed, and individual details of each download thread.
All temp files, log files and the resulting binary files you're downloading end up in the 
current directory. Make sure you have plenty of disk space.

Details of the usenet server you're connecting to are kept in your ~/.nznzbrc file. 
Currently there aren't too many options to fuss over:

   # A comment
   server = myusenet.serve.net
   port = 119

   user=hamster
   pass=getwell

   threads=7

The .nznzbrc file is reasonably free form; you can have blank lines, comments, and 
spaces before and after the = signs. server is mandatory, but port will default to 119 if
you leave it out. The user, pass settings are only required if your
usenet server requires authentication. If you leave the user/pass settings out of the
.nznzbrc file, it'll assume that no authentication is required. The threads setting defines
how many download threads you want running. Generally the more you have, the faster 
you get your files. There is a limit of 15 threads, and you should check with your
usenet provider, as they may impose a limit anyway.

nznzb has a builtin yEnc decoder so as a 'part' is downloaded it'll be written to a 
temp file called 'part_??', when that's complete, the builtin yEnc decoder will try to 
decode the file. If the decode successds the part_?? file is deleted, and just get the
resulting output file. If it fails for any reason, it'll rename the part_?? file to
something like


   crap.rar.SIZEMISMATCH
   crap.rar.CRCFAILED

where 'crap.rar' is meant to be the real name of the file. You might want to try 
uudeview on the supposed broken file, just in case my yEnc decoder is crap.

If you try to download something which is UUencoded, then nznzb will try to run 
the external program 'uudecode' against it.


Compiling
=========
Too easy:

   gcc -o nznzb -lpthread nznzb.c

That works on linux. If you're porting to other platforms, the most likely prob is the
type used for the crc32 table. I've just wacked in 'unsigned int' but technically it
should be a uint32.

Have fun. I wrote this because I was frustrated with all the dependencies that other 
linux NZB tools have.



History
=======
v0.1 - never released
v0.2 - experimental absolute download speed code.
v0.3 - Handle &#x26; type special chars
v0.4 - better yEnc decoding. Handle out of order segments
v0.5 - crap pretty printing
v0.6 - handle uuencoded rubbish
v0.7 - handle uuencoded rubbish. Am just calling uudecode externally
v0.8 - ??
v0.9 - Added padding for files where some segments are missing. It uses the content of other 
       existing segments to fill in the gaps in the output file such that the output file will 
       be corrupt, but will have far more useable blocks in it if you use the par2 tools to fix it
v0.10 - Show total percent complete and ETA of finish
v0.11 - Try to detect segment overruns
v0.12 - Handle dead threads
v0.13
v0.14 - handle auth failures
v0.15 - Terminate broken threads better
v0.16 - alarms (NB: If you get a dead connection during a BODY, it restarts
        from the beginning of the RAR part (ie. it doesn't just retry the
        last segment)
v0.17 - better monitoring of subthreads
v0.20 - clean up and release. The alarm stuff is in the code but doesn't work right.



