Created
September 10, 2023 15:20
-
-
Save meysampg/0c487854775885e42a3ea646c6b37492 to your computer and use it in GitHub Desktop.
Download using axel by reading links from a file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if ! command -v axel &> /dev/null; then | |
echo "axel is not installed. Please install it before running this script." | |
exit 1 | |
fi | |
if [ $# -ne 1 ]; then | |
echo "Usage: $0 <input_file>" | |
exit 1 | |
fi | |
input_file="$1" | |
if [ ! -f "$input_file" ]; then | |
echo "Input file '$input_file' not found." | |
exit 1 | |
fi | |
while IFS= read -r link; do | |
filename=$(basename "$link") | |
axel -n 16 -o "$filename" "$link" | |
done < "$input_file" | |
echo "Downloads completed." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment