This commit is contained in:
2025-09-01 18:40:50 -06:00
parent d27935f8ba
commit f8d9328c67
+3 -2
View File
@@ -22,8 +22,9 @@ cat "$tmp_links_file" | \
# get default basename of downloaded file
file_basename=$(basename "$line")
# download the file to a tmp
echo "Downloading $line to $outdir/$file_basename"
# download the file to a tmp
curl -s -o "$tmp_file_download" "$line"
# get the file type
@@ -41,7 +42,7 @@ cat "$tmp_links_file" | \
if [[ "$item" == "$type" ]]; then
# rename the downloaded file
new_name="$outdir/$namehash.$(echo ${exts_arr[$count]})"
echo -e "\tRenaming $file_basename to $new_name"
echo -e "Saving $line to $new_name"
mv "$tmp_file_download" "$new_name"
if [ $? -ne 0 ]; then
echo -e "\nFailed to rename $tmp_file_download to $new_name\n\turl\n\t$line\n\ttype $type\n\tbase name: $file_basename\n"