fallback if uploader not present
This commit is contained in:
parent
505aae9f60
commit
832df85078
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue
Block a user