fallback if uploader not present

This commit is contained in:
gutmet 2021-06-24 13:20:22 +02:00
parent 505aae9f60
commit 832df85078

View File

@ -8,6 +8,9 @@ noItems="$2"
playlistJSON=`youtube-dl "$playlistURL" --flat-playlist -J --playlist-end "$noItems"` playlistJSON=`youtube-dl "$playlistURL" --flat-playlist -J --playlist-end "$noItems"`
uploader=`echo "$playlistJSON" | jq -r '.uploader'` uploader=`echo "$playlistJSON" | jq -r '.uploader'`
if [ "$uploader" = "null" ] || [ "$uploader" = "" ]; then
uploader=`echo "$playlistJSON" | jq -r '.title'`
fi
entries=`echo "$playlistJSON" | jq -r '.entries[] | .url + " " + .title'` entries=`echo "$playlistJSON" | jq -r '.entries[] | .url + " " + .title'`
if [ "$entries" = "null" ] || [ "$entries" = "" ]; then if [ "$entries" = "null" ] || [ "$entries" = "" ]; then