Files
dotfiles/scripts/shell/gdl.sh
2024-05-25 14:18:36 -03:00

19 lines
324 B
Bash
Executable File

#!/bin/bash
media_url=$1
gallery-dl $media_url
cmd_exit_code=$?
if [[ $cmd_exit_code -ne 0 ]]; then
printf "\n"
echo "[ERROR] `basename $0`: Could not download url \"$media_url\""
echo "[ERROR] Exit status: $cmd_exit_code"
exit 1
fi
find gallery-dl -type f -exec mv '{}' . \;
rm --recursive gallery-dl