Skip to content

Instantly share code, notes, and snippets.

@shdwkl
Created February 6, 2025 09:11
Show Gist options
  • Select an option

  • Save shdwkl/d8fa905dbe84eb10c83a06f9a24b90f4 to your computer and use it in GitHub Desktop.

Select an option

Save shdwkl/d8fa905dbe84eb10c83a06f9a24b90f4 to your computer and use it in GitHub Desktop.
Fetch Quran recitiation from mp3quran.net
#!/bin/bash
# Set the download directory
download_dir="quran_downloads"
# Create the download directory if it doesn't exist
mkdir -p "$download_dir"
# Loop through the numbers 1 to 114
for i in $(seq 1 114); do
# Format the file number with leading zeros
formatted_number=$(printf "%03d" $i)
# Construct the URL
url="https://server9.mp3quran.net/download/qurashi/${formatted_number}.mp3"
# Construct the filename
filename="${download_dir}/${formatted_number}.mp3"
# Download the file asynchronously using wget
wget -q --show-progress -c "$url" -O "$filename" &
done
# Wait for all background processes to finish
wait
echo "Downloads complete."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment