Page 1 of 1
Downloading par files when required
Posted: April 13th, 2009, 7:16 pm
by Gryffin
Hi
Is it possible to only download par files when it is detected that a repair is required and not always download them?
Thanks
Re: Downloading par files when required
Posted: April 13th, 2009, 7:19 pm
by switch
That is currently what is done.
Only a very small part of each par2 file is downloaded to get an accurate filename, then it is put in a paused state in your queue, and is only downloaded if par2 requires more repair blocks.
Re: Downloading par files when required
Posted: April 15th, 2009, 7:53 am
by MageMinds
switch wrote:
Only a very small part of each par2 file is downloaded to get an accurate filename...
I'm curious about that, can you explain a little bit more, this is just out of curiosity. I like to know how things works...
Re: Downloading par files when required
Posted: April 15th, 2009, 8:22 am
by switch
Well since usenet was hardly designed for binary files, we need to be clever in the way we handle things.
.NZB Files give us only the subject line of each file, not the filename. This usually includes the filename however it is impossible to reliably parse it out due to there not being an enforced standard in the way subjects are named. yEnc encoded posts usually are easy to find the filename as it is encased in quotes, eg: "filename.ext" yEnc, however we cannot always rely on these to be present or even correct.
So when an nzb is imported all files with subjects containing '.par2' (or suspected filenames ending with .par2 if the filename was parsed) are moved to the top of download order for that nzb.
The first part (well first article) of the .par2 file is then downloaded. Articles are encoded in either yEnc or uuencoded and as part of that encoding they contain the actual, reliable, filename listed in the first line of the article. We parse out this filename and set it as the filename to be used when assembling the file.
Since the file was found to be an actual .par2 file it is sent to the bottom of the queue into a waiting state until par2.exe says it requires more blocks, then the correct amount of par2 files are unpaused and downloaded and par2.exe is run again to repair.