Assemble of the file, with missing article (0.7.9)

Report & discuss bugs found in SABnzbd
Forum rules
Help us help you:
  • Are you using the latest stable version of SABnzbd? Downloads page.
  • Tell us what system you run SABnzbd on.
  • Adhere to the forum rules.
  • Do you experience problems during downloading?
    Check your connection in Status and Interface settings window.
    Use Test Server in Config > Servers.
    We will probably ask you to do a test using only basic settings.
  • Do you experience problems during repair or unpacking?
    Enable +Debug logging in the Status and Interface settings window and share the relevant parts of the log here using [ code ] sections.
Post Reply
benjarobin
Newbie
Newbie
Posts: 3
Joined: January 7th, 2013, 7:39 pm

Assemble of the file, with missing article (0.7.9)

Post 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
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

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

Post 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.
benjarobin
Newbie
Newbie
Posts: 3
Joined: January 7th, 2013, 7:39 pm

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

Post 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 ?
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

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

Post 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.
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

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

Post by shypike »

Ways like?
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

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

Post by shypike »

I'll see what I can do.
callten061
Newbie
Newbie
Posts: 6
Joined: July 21st, 2012, 6:09 am

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

Post by callten061 »

this is what i need..!
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

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

Post 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.
Post Reply