Closed csachs closed 1 year ago
Thanks for your work. But I am still confused about how to resume the download process when failing in the following command
kaggle competitions download -c imagenet-object-localization-challenge
Thanks for your work. But I am still confused about how to resume the download process when failing in the following command
kaggle competitions download -c imagenet-object-localization-challenge
I did not test it yet, but seeing the code i would say that you just have to relaunch the same command, it automatically detects if the file exists and will send appropriate headers according to existing file size to start again where it stopped.
EDIT: since the check for existing file is done just before the modified function is called , you need to add the --force option
@csachs maybe you could also change the return of the download_needed
to True when
exactly like what you did at the beginning of the download_file
function
that way it would avoid to have to pass the --force option.
Also i believe the --force is meant to force the download to restart maybe that point could be discussed, but IF my belief about this option behavior is right, an idea would be to pass not force
to the new resume
parameter if the user truly want to restart rather than continue an existing file (i dont really why someone would want to do that unless they have some way to know that the part they already downloaded is corrupted or bad in some way)
Thanks @csachs and @tmijieux, I'm going to implement this solution.
The source of code is internal, and is copied here, that's why I cannot merge this PR directly.
Reopen of #328 (can't change the target branch). ( Should fix #24 , #310 , #316 )