From b2f192bbc460c14f536d17a396e2e19607a475d6 Mon Sep 17 00:00:00 2001 From: dyknon Date: Tue, 1 Sep 2026 00:44:00 +0900 Subject: yt-dlp-and-sleep: make it robust --- yt-dlp-and-sleep.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/yt-dlp-and-sleep.sh b/yt-dlp-and-sleep.sh index 73af1c5..9d0ca49 100755 --- a/yt-dlp-and-sleep.sh +++ b/yt-dlp-and-sleep.sh @@ -8,6 +8,11 @@ ( yt-dlp "$@" \ | tee /dev/fd/3 \ - | jq '[.formats|.[]|.available_at|select(. != null)|(. - now)]|max' \ - | (read t && sleep $t) + | jq '[ + .formats | .[] | .available_at + | select(. != null) + | (. - now) + | select(. > 0) + ]|max + 0' \ + | (read t && sleep $t; :) ) 3>&1 -- cgit v1.2.3