Improve download_component to allow for resuming failed downloads #197
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi! I made some changes to the download_component function to improve its functionality. Now, if a download fails, the function will attempt to resume the download from where it left off instead of starting from the beginning. This should help avoid having to download large files multiple times due to failed downloads.
I added an additional check to verify the MD5 hash of the downloaded file to ensure that it matches the expected value. If the hash does not match, the function will delete the partially downloaded file and attempt to download it again.
I also added a check to determine if the aria2c package is installed on the system, and if so, it will be used to download the file. If aria2c is not installed, the function will attempt to use curl or wget to download the file.
I hope these changes are helpful. Please let me know if you have any questions or concerns. Thank you!