added check for nuked channels

This commit is contained in:
Alexander Bocken 2021-06-26 19:40:59 +02:00
parent c337ca7b64
commit 2f12e793bd
Signed by: Alexander
GPG Key ID: 1D237BE83F9B05E8

10
ripper
View File

@ -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 '<title>Error 404 (Not Found)!!1</title>'
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' |