Improves gdl.sh and images-indexer.sh scripts

This commit is contained in:
Matheus Albino
2024-06-19 07:57:11 -03:00
parent 8e732e0061
commit f4464491bb
2 changed files with 11 additions and 5 deletions

View File

@@ -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=()