#!/bin/bash
URL="https://myrient.erista.me/files/Touhou%20Project%20Collection/"
WGET_CMD="wget -m -np -c -e robots=off -R \"index.html*\" --retry-connrefused --read-timeout=20 --timeout=15"
while true; do
eval $WGET_CMD "$URL"
EXIT_CODE=$?
if [ $EXIT_CODE -eq 0 ]; then
break
else
sleep 10
fi
done