Created
April 4, 2022 22:13
-
-
Save thakyZ/ef1746eb1ef26f60ad40030cc5887edf to your computer and use it in GitHub Desktop.
Downloads all files in a web directory when web directory uses h5ai
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 | |
path=$1 | |
download="https://files.example.com/${path}/" | |
mapfile -t files < <(w3m "${download}" | grep .z | sed 's/file [[:space:]]*//g' | sed 's/[[:space:]]*2022.*KB$//g' | grep -v "Name") | |
mkdir "${path}" | |
for f in "${files[@]}"; do | |
wget "${download}${f}" -O "${path}/${f}" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment