only prints wrong channel format if some channels present

This commit is contained in:
Alexander Bocken 2021-01-02 08:23:29 +01:00
parent 2db011e693
commit 917e70f855
Signed by: Alexander
GPG Key ID: 1D237BE83F9B05E8

View File

@ -33,7 +33,7 @@ echo "Scanning for new Videos to download"
echo "Scanning on Youtube:" echo "Scanning on Youtube:"
IDs="$( grep 'youtube' "$CHANNELSFILE" | grep -v '^#' | grep 'channel' | sed 's/https:\/\/www\.youtube\.com\/channel\///')" IDs="$( grep 'youtube' "$CHANNELSFILE" | grep -v '^#' | grep 'channel' | sed 's/https:\/\/www\.youtube\.com\/channel\///')"
not_correctly_formatted="$(grep 'youtube' "$CHANNELSFILE" | grep -v '^#' | grep -v 'channel')" not_correctly_formatted="$(grep 'youtube' "$CHANNELSFILE" | grep -v '^#' | grep -v 'channel')"
if [ "$( echo "$not_correctly_formatted" | wc -l )" -gt 0 ]; then if [ -n "$not_correctly_formatted" ]; then
echo Please fix the following channel urls to be scannable: echo Please fix the following channel urls to be scannable:
echo "$not_correctly_formatted" echo "$not_correctly_formatted"
echo "They need to be in the 'https://www.youtube.com/channel/...' format" echo "They need to be in the 'https://www.youtube.com/channel/...' format"