From 08a6cdc5085fd04b562931bc5701d736fbb66fcd Mon Sep 17 00:00:00 2001 From: Alexander Bocken Date: Sun, 27 Jun 2021 16:05:56 +0200 Subject: [PATCH] better jq invocation --- ripper | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ripper b/ripper index 49180f0..c68584e 100755 --- a/ripper +++ b/ripper @@ -88,8 +88,8 @@ for channel_id in $IDs; do echo "Is https://youtube.com/channel/$channel_id still up?" else #Only try to download videos, not sheduled livestreams - echo "$json" | jq '.items[] | select(.snippet.liveBroadcastContent != "upcoming") | .id.videoId' | - tr -d '"' | grep -v '^null$'| + echo "$json" | jq '.items[] | select(.snippet.liveBroadcastContent != "upcoming") | select(.id.videoId != null) |.id.videoId' | + tr -d '"' | sed 's/^/https:\/\/www\.youtube\.com\/watch\?v=/' | grep -vf "$BLACKLIST" >> /tmp/todownload$$ fi