Skip to content

Conversation

@csachs
Copy link

@csachs csachs commented Mar 7, 2023

Reopen of #328 (can't change the target branch).
( Should fix #24 , #310 , #316 )

@DapengFeng
Copy link

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

@tmijieux
Copy link

tmijieux commented May 7, 2023

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

@tmijieux
Copy link

tmijieux commented May 7, 2023

@csachs maybe you could also change the return of the download_needed to True when

  • "date check" is good( local file was created after remote 'Last-Modified')
  • BUT local file size is smaller than remote file size (which is detection that the file download was interrupted)

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)

@Philmod
Copy link
Contributor

Philmod commented Jun 27, 2023

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.

@Philmod
Copy link
Contributor

Philmod commented Jun 29, 2023

@Philmod Philmod closed this Jun 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Download resumption

4 participants