Move logic out of for loop in youtube-upload-wrapper