-
Notifications
You must be signed in to change notification settings - Fork 225
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix resumable_download
for fully downloaded files
#1060
Fix resumable_download
for fully downloaded files
#1060
Conversation
The file should only be considered fully downloaded WHEN the 416 error code is returned AND the file size returned in the Content-Range header matches that on local disk. Not all servers include the Content-Range header with the 416 response, meaning that the server does not support resuming downloads. Here is an older patch from my tree. Feel free to adapt.
|
@rouseabout Fair enough. If the server does not support resumable downloads though, we should not simply fail but rather try to download from scratch with a request without range headers then. Updated PR accordingly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
Please just fix the CI checks |
b5257e9
to
65f45c3
Compare
@pzelasko only black was failing, should be ok now. |
When
resumable_download
is called and the file is fully downloaded, the requested range starts after the file ends, which yields HTTP error 416. It seems logical that in this case the exception should not be raised, but rather Lhotse should report that the file is already downloaded.