Skip to content
This repository has been archived by the owner on Oct 10, 2022. It is now read-only.

When downloading, fragments are sometimes incorrectly 2 bytes long after processing for no apparent reason. #17

Closed
DavidBerdik opened this issue Jun 30, 2019 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@DavidBerdik
Copy link
Owner

When downloading, fragments are sometimes incorrectly 2 bytes long after processing for no apparent reason. This of course causes the resulting output file to be corrupted. Oddly, this behavior is not consistent. Trying to reproduce the bug results in either one of two scenarios:

  • The bug does not occur at all and the file is downloaded properly
  • The bug occurs, but not in the same place as in previous tests
@DavidBerdik DavidBerdik added the bug Something isn't working label Jun 30, 2019
@DavidBerdik
Copy link
Owner Author

Probable source of bug: Google Drive has a bug that sometimes causes images in Docs to not get converted properly, and instead, the image is replaced with a 1x1 image. When this happens, the image that is retrieved from the Word document will have three bytes which, after InfiniDrive removes what is supposed to be the spacer byte, will leave us with 2 bytes.

A simple solution to this problem would be to check that the list of bytes generated from the image does not have a length of 3 before processing and writing to the document. If it does have a length of 3, the Doc should be refetched from Drive.

@DavidBerdik DavidBerdik self-assigned this Jun 30, 2019
@DavidBerdik
Copy link
Owner Author

This issue should be fixed by 6ae15cb. This issue will be reopened if necessary.

@DavidBerdik
Copy link
Owner Author

@innowebka You are probably receiving this error because you are not specifying a full file path. Instead, you are only specifying the directory to which you wish to download.

If you wish to use the download command to save a text file with the name example.txt, here is how the command you listed above should be formatted.

python InfiniDrive.py download FILEID C:\users\USERNAME\desktop\InfiniDrive-master\example.txt

@DavidBerdik
Copy link
Owner Author

Thanks ❤️

You're welcome!

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants
@DavidBerdik and others