scripts: fix video downloader

This commit is contained in:
Leonardo Eugênio 2025-10-03 20:59:55 -03:00
parent a1a6df8eac
commit 4cab0e1e7a

View file

@ -1,10 +1,19 @@
#!/bin/sh #!/bin/sh
set -euo pipefail
cleanup() {
if test "$?" != 0; then
notify-send "Failed to download"
fi
}
trap cleanup EXIT INT
DIR=$(mktemp -d) DIR=$(mktemp -d)
cd "$DIR" 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)" FILENAME="$(ls | head -n1)"