commit c9aeeb561d8585f0fb9816c7c953d3aede0fc98f parent df37469d6f5062fd8f1087829eb411d3c891138f Author: regexghost <dev@regexghost.com> Date: Mon, 17 Aug 2026 16:33:16 +0100 all option and handle empty input in download-vids Diffstat:
| M | terminal-scripts/download-vids.sh | | | 14 | ++++++++++---- |
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/terminal-scripts/download-vids.sh b/terminal-scripts/download-vids.sh @@ -31,10 +31,16 @@ read -p "Select videos to download (e.g. 1 2 3): " toDownload [ -f /tmp/to_download ] && rm /tmp/to_download -for i in $toDownload; do - path="$(find "$targetDir/Shorts" "$targetDir/Videos" -type f | sort | sed -n "${i}p")" - echo "$path" >> /tmp/to_download -done +[ "$toDownload" = "" ] && exit + +if [ "$toDownload" = "a" ] || [ "$toDownload" = "all" ]; then + find "$targetDir/Shorts" "$targetDir/Videos" -type f | sort >> /tmp/to_download +else + for i in $toDownload; do + path="$(find "$targetDir/Shorts" "$targetDir/Videos" -type f | sort | sed -n "${i}p")" + echo "$path" >> /tmp/to_download + done +fi while read -r path; do id="$(basename "$path" | sed 's/.txt//g')"