Page 1 of 1

Assemble of the file, with missing article (0.7.9)

Posted: January 7th, 2013, 7:58 pm
by benjarobin
The thread which builds and writes the file to disk may contains an error : sabnzbd/assembler.py
In the _assemble function, line 154 we are logging for missing file, well this is fine, but I think this part can be improved in case of error.

Let say we have a file which is split into 3 articles : A, B and C. The expected output file is : "A B C"
But let say that B cannot be found and is missing. The written file will be "A B" and not "A random bytes B".

We should write 0x00 or 0xFF if the article "B" is missing and not just skip it.
We should also check that the decoded article is equals to the expected size of the article.

The goal is : even if there are errors, missing files, ... the output file size shall be equals to the size described into the .nzb file.
And the data of each article are located at the proper position into the output file.

I think the fix is pretty easy, if I have time I will write the patch, but I am not an expert in python
************************
Why I am asking this ?

I did download a video with missing article. With sabnzbd vlc cannot read it (vlc is not expected this block of data at this location) , but if I download it with an other client I can (there is still missing part)

And I think PAR file cannot repair (I may be wrong on this assertion) the file since the written data block are not located to the proper position

Thanks a lot for this great software

PS: I am french

Re: Assemble of the file, with missing article (0.7.9)

Posted: January 9th, 2013, 7:01 am
by shypike
Par2 is not helped by just padding missing parts of a file.
Other than that, the sizes in the NZB do not reflect the actual
number of bytes in the file segments. Instead they describe how many
characters there are in the articles.
Those two numbers are not the same. The number of characters in an article is
the same or more than the number of bytes in the file segment.
99% of the time, it's more.

Re: Assemble of the file, with missing article (0.7.9)

Posted: January 9th, 2013, 9:05 am
by benjarobin
Why another NZ client successfully creates the downloaded file with the exact size ?
Well for the size of the article I was thinking the same as you, this is the size of the raw article before decoding it. So how the other client does ?
He did add padding for missing parts of the file. So how he can guess the size of the missing part ?

Re: Assemble of the file, with missing article (0.7.9)

Posted: January 9th, 2013, 12:59 pm
by shypike
It is actually guessing, which can be successful if you look at the other articles.
Usually posters use a fixed number of bytes per article.
But the more important part is, that there is no advantage to padding.

Re: Assemble of the file, with missing article (0.7.9)

Posted: April 1st, 2013, 1:45 am
by shypike
Ways like?

Re: Assemble of the file, with missing article (0.7.9)

Posted: April 2nd, 2013, 2:06 am
by shypike
I'll see what I can do.

Re: Assemble of the file, with missing article (0.7.9)

Posted: May 5th, 2013, 7:47 am
by callten061
this is what i need..!

Re: Assemble of the file, with missing article (0.7.9)

Posted: May 5th, 2013, 2:11 pm
by shypike
The trouble is still that it is impossible to determine the size of the required gap from the NZB file.
The NZB file contains sizes of unprocessed data, the actual size cannot be determined without the actual data.
It would be mere guesswork.