diff --git a/youtube-par-cmd b/youtube-par-cmd index 1c5e5c5..bfb34bd 100755 --- a/youtube-par-cmd +++ b/youtube-par-cmd @@ -13,8 +13,12 @@ playlistInfo="$playlistTitle" output="$(mkdir "$playlistTitle")" status=$? if [ $status -ne 0 ]; then - playlistTitle=`echo "$playlistJSON" | jq -r '.id'` - mkdir "$playlistTitle" + output="$(cd "$playlistTitle")" + status=$? + if [ $status -ne 0 ]; then + playlistTitle=`echo "$playlistJSON" | jq -r '.id'` + mkdir "$playlistTitle" + fi fi cd "$playlistTitle"