Skip to content

Instantly share code, notes, and snippets.

@gordinmitya
Last active February 15, 2024 08:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gordinmitya/0a7e52855183328f356fe31115fd1487 to your computer and use it in GitHub Desktop.
Save gordinmitya/0a7e52855183328f356fe31115fd1487 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Base URL for downloads
BASE_URL="https://data.vision.ee.ethz.ch/cvl/rrothe/imdb-wiki/static/"
# Array of filenames to download
FILES=(
"imdb_0.tar"
"imdb_1.tar"
"imdb_2.tar"
"imdb_3.tar"
"imdb_4.tar"
"imdb_5.tar"
"imdb_6.tar"
"imdb_7.tar"
"imdb_8.tar"
"imdb_9.tar"
"imdb_meta.tar"
"wiki.tar.gz"
)
# Loop through each file and attempt to download it
for FILE in "${FILES[@]}"; do
echo "Attempting to download $FILE..."
wget "$BASE_URL/$FILE" || echo "$FILE download failed, proceeding to next file..."
done
for FILE in "${FILES[@]}"; do
# Download the corresponding MD5 file
MD5_FILE="${FILE}_md5sum.txt"
# Correcting MD5 file naming for special cases
if [ "$FILE" == "wiki.tar.gz" ]; then
MD5_FILE="wiki_md5sum.txt" # Adjust this line if the actual MD5 file name differs
fi
wget "$BASE_URL/$MD5_FILE" -O $MD5_FILE && echo "$MD5_FILE download complete."
echo "Downloading MD5 file for $FILE..."
if wget "$BASE_URL/$MD5_FILE" -O $MD5_FILE; then
echo "$MD5_FILE download complete. Verifying $FILE..."
if md5sum -c $MD5_FILE; then
echo "$FILE verification successful."
else
echo "$FILE verification failed."
fi
else
echo "Failed to download $MD5_FILE. Skipping verification for $FILE."
fi
done
echo "All downloads attempted."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment