Improves gdl.sh and images-indexer.sh scripts
This commit is contained in:
@@ -8,13 +8,11 @@ fi
|
||||
media_url=$1
|
||||
|
||||
gallery-dl $media_url
|
||||
cmd_exit_code=$?
|
||||
|
||||
if [[ $cmd_exit_code -ne 0 ]]; then
|
||||
if [[ $? -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
|
||||
|
||||
@@ -20,7 +20,7 @@ if [ ${#commands_not_found[@]} -ne 0 ]; then
|
||||
fi
|
||||
|
||||
cur_dir=`pwd`
|
||||
furry_commission_ideas_path=/mnt/e/home/Documents/sync/nextcloud-pudimxyz-cloud/furry-commission-ideas
|
||||
furry_commission_ideas_path=/mnt/e/home/sync/nextcloud/furry-commission-ideas
|
||||
furry_commission_ideas_urls_filename="urls.txt"
|
||||
scripts_path=/home/cloud/repos/personal-devboot/scripts/shell
|
||||
|
||||
@@ -47,6 +47,12 @@ done
|
||||
# remove trailing slashes
|
||||
media_url=`sed 's:/*$::' <<< "$media_url"`
|
||||
|
||||
url_regex='(https?)://[-[:alnum:]\+&@#/%?=~_|!:,.;]*[-[:alnum:]\+&@#/%=~_|]'
|
||||
if [[ ! $media_url =~ $url_regex ]]; then
|
||||
echo "The URL informed is not valid."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cd $furry_commission_ideas_path
|
||||
|
||||
existing_folders=($(find * -type d -not -path artists -not -path kinks -not -path ideas))
|
||||
@@ -130,7 +136,9 @@ if [ -f "$furry_commission_ideas_urls_filename" ] && grep -qE "$media_url" -i "$
|
||||
exit 0
|
||||
fi
|
||||
|
||||
command_output=`$scripts_path/gdl.sh $media_url`
|
||||
if ! command_output=$($scripts_path/gdl.sh $media_url); then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
media_filenames=()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user