From 9a64735f3cacec31a49c7ac808bcce9452d9694b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Kucharczyk?= Date: Sat, 16 Nov 2024 20:23:25 +0100 Subject: [PATCH] yt-dlp-ntfy: filter out keepalive events --- yt-dlp-ntfy.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/yt-dlp-ntfy.sh b/yt-dlp-ntfy.sh index a754b53..97b4c77 100755 --- a/yt-dlp-ntfy.sh +++ b/yt-dlp-ntfy.sh @@ -21,6 +21,8 @@ ACCESS_TOKEN="$NTFY_ACCESS_TOKEN" # Run the script in an infinite loop to listen for new messages while true; do while read -r message; do + event=$(echo "$message" | jq -r '.event') + [[ "$event" == "keepalive" ]] && continue video_url=$(echo "$message" | jq -r '.message') if [[ $video_url =~ ^https?:// ]]; then