From 4cab0e1e7aed4bcbf240afef99c02e97a280dc14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leonardo=20Eug=C3=AAnio?= Date: Fri, 3 Oct 2025 20:59:55 -0300 Subject: [PATCH] scripts: fix video downloader --- scripts/down_meme | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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)"