Use wget2 by default

Signed-off-by: Evan Lloyd New-Schmidt <evan@new-schmidt.com>
This commit is contained in:
Evan Lloyd New-Schmidt 2023-08-18 14:08:11 -04:00
parent 9d2d2e5f39
commit 4d9199235a

View file

@ -109,8 +109,17 @@ if [ ! -e "$DOWNLOAD_DIR" ]; then
fi
log "Downloading available dumps"
# shellcheck disable=SC2086 # URLS should be expanded on spaces.
wget --directory-prefix "$DOWNLOAD_DIR" --continue $URLS
if type wget2 > /dev/null; then
# NOTE: Wikipedia requests no more than 2 concurrent downloads.
# See https://dumps.wikimedia.org/ for more info.
# shellcheck disable=SC2086 # URLS should be expanded on spaces.
wget2 --max-threads 2 --verbose --progress=bar --directory-prefix "$DOWNLOAD_DIR" --continue $URLS
else
log "WARN: wget2 is not available, falling back to sequential downloads"
# shellcheck disable=SC2086 # URLS should be expanded on spaces.
wget --directory-prefix "$DOWNLOAD_DIR" --continue $URLS
fi
if [ $MISSING_DUMPS -gt 0 ]; then
log "$MISSING_DUMPS dumps not available yet"