use fallback for very first quota exceeding channel as well

This commit is contained in:
Alexander Bocken 2021-01-09 21:53:05 +01:00
parent a8a6cc347e
commit ea0cca7be1
Signed by: Alexander
GPG Key ID: 1D237BE83F9B05E8

5
ripper
View File

@ -65,8 +65,9 @@ for channel_id in $IDs; do
echo "YT API Quota exceeded, using fallback"
LEGACYMODE=1
fi
elif [ -n "$LEGACYMODE" ];then
curl -s "https://www.youtube.com/feeds/videos.xml?channel_id=$channel_id"> /tmp/"${channel_id}.xml"
fi
if [ -n "$LEGACYMODE" ];then
curl -s "https://www.youtube.com/feeds/videos.xml?channel_id=$channel_id" > /tmp/"${channel_id}.xml"
python -c "from lxml import etree
file=\"/tmp/${channel_id}.xml\"
root = etree.parse(file)