Downloading par files when required

Want something added? Ask for it here.
Post Reply
Gryffin
Newbie
Newbie
Posts: 1
Joined: April 13th, 2009, 7:05 pm

Downloading par files when required

Post 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
User avatar
switch
Moderator
Moderator
Posts: 1380
Joined: January 17th, 2008, 3:55 pm
Location: UK

Re: Downloading par files when required

Post 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.
MageMinds
Release Testers
Release Testers
Posts: 73
Joined: August 14th, 2008, 6:37 am

Re: Downloading par files when required

Post 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...
User avatar
switch
Moderator
Moderator
Posts: 1380
Joined: January 17th, 2008, 3:55 pm
Location: UK

Re: Downloading par files when required

Post 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.
Last edited by switch on April 15th, 2009, 8:24 am, edited 1 time in total.
Post Reply