diff --git a/scripts/down_meme b/scripts/down_meme index 133fe33..bbc211b 100755 --- a/scripts/down_meme +++ b/scripts/down_meme @@ -1,10 +1,19 @@ #!/bin/sh +set -euo pipefail + +cleanup() { + if test "$?" != 0; then + notify-send "Failed to download" + fi +} +trap cleanup EXIT INT + DIR=$(mktemp -d) cd "$DIR" -yt-dlp --merge-output-format mp4 "$(wl-paste)" +yt-dlp --cookies-from-browser firefox --merge-output-format mp4 "$(wl-paste)" FILENAME="$(ls | head -n1)"