From 2f12e793bd256c0258b092ea879e77c19136fe81 Mon Sep 17 00:00:00 2001 From: Alexander Bocken Date: Sat, 26 Jun 2021 19:40:59 +0200 Subject: [PATCH] added check for nuked channels --- ripper | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/ripper b/ripper index 719cfb4..39d7dad 100755 --- a/ripper +++ b/ripper @@ -67,10 +67,16 @@ for channel_id in $IDs; do fi fi if [ -n "$LEGACYMODE" ];then - curl -s "https://www.youtube.com/feeds/videos.xml?channel_id=$channel_id" | - xml2 | grep '^/feed/entry/yt:videoId=' | + channelxml="$( curl -s "https://www.youtube.com/feeds/videos.xml?channel_id=$channel_id" )" + if echo "$channelxml" | grep -q 'Error 404 (Not Found)!!1' + then + echo "Grabbing rss feed for channel failed" + echo "Is https://youtube.com/channel/$channel_id still up?" + else + echo "$channelxml" | xml2 | grep '^/feed/entry/yt:videoId=' | sed 's|^\/feed\/entry\/yt:videoId=|https:\/\/www\.youtube\.com\/watch\?v=|' | grep -vf "$BLACKLIST" >> /tmp/todownload$$ + fi else #Only try to download videos, not sheduled livestreams echo "$json" | jq '.items[] | select(.snippet.liveBroadcastContent != "upcoming") | .id.videoId' |