Fixes gdltool.sh for links with spaces
This commit is contained in:
@@ -36,7 +36,7 @@ while [ "$#" -gt 0 ]; do
|
||||
esac
|
||||
done
|
||||
|
||||
commands_to_check=(gallery-dl gdl.sh feh xdotool stoml)
|
||||
commands_to_check=(gallery-dl gdl.sh feh xdotool)
|
||||
|
||||
commands_not_found=()
|
||||
for command in ${commands_to_check[@]}; do
|
||||
@@ -141,7 +141,7 @@ input_selected_folders_and_fill_selected_folders_variable() {
|
||||
|
||||
mkdir --parents "$new_foldername"
|
||||
|
||||
selected_folders=("$new_foldername")
|
||||
selected_folders+=("$new_foldername")
|
||||
else
|
||||
for selected_option in ${selected_options[@]}; do
|
||||
selected_folder=${existing_folders[$selected_option]}
|
||||
@@ -447,7 +447,7 @@ image_download_steps() {
|
||||
echo ""
|
||||
echo "Download starting..."
|
||||
|
||||
downloaded_images=($(gallery-dl --directory ${tmp_dir} $url_to_download))
|
||||
downloaded_images=$(gallery-dl --directory ${tmp_dir} $url_to_download)
|
||||
|
||||
if [[ $? -ne 0 ]]; then
|
||||
unsucessful_downloads+="$url_to_download"
|
||||
@@ -456,8 +456,9 @@ image_download_steps() {
|
||||
|
||||
echo "Download finished."
|
||||
|
||||
for downloaded_image_temp_path in "${downloaded_images[@]}"; do
|
||||
if [ $downloaded_image_temp_path == '#' ]; then
|
||||
# for downloaded_image_temp_path in "${downloaded_images[@]}"; do
|
||||
while read -r downloaded_image_temp_path; do
|
||||
if [ "$downloaded_image_temp_path" == '#' ]; then
|
||||
continue
|
||||
fi
|
||||
|
||||
@@ -466,17 +467,17 @@ image_download_steps() {
|
||||
|
||||
file_extension=$(get_extension_from_filename "$downloaded_image_temp_path")
|
||||
|
||||
final_temp_filepath_md5=($(md5sum $downloaded_image_temp_path))
|
||||
final_temp_filepath_md5=($(md5sum "$downloaded_image_temp_path"))
|
||||
|
||||
final_filename="${final_temp_filepath_md5}.${file_extension}"
|
||||
|
||||
cp $downloaded_image_temp_path ./${final_filename}
|
||||
cp "$downloaded_image_temp_path" ./${final_filename}
|
||||
|
||||
echo "$final_filename,$url_to_download" >>$furry_commission_ideas_urls_filename
|
||||
done
|
||||
done
|
||||
|
||||
rm $downloaded_image_temp_path
|
||||
rm "$downloaded_image_temp_path"
|
||||
done < <(echo "$downloaded_images")
|
||||
}
|
||||
|
||||
fill_existing_folders_array
|
||||
|
||||
Reference in New Issue
Block a user