Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tell the package user that he forgot to set visibility, and close browser #34

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,12 @@ async function uploadVideo (videoJSON) {
}
// await page.waitForXPath('//*[contains(text(),"Finished processing")]', { timeout: 0})
// Wait for closebtn to show up
await page.waitForXPath(closeBtnXPath)
try {
await page.waitForXPath(closeBtnXPath)
} catch (e) {
await browser.close()
throw new Error('Please make sure you set up your default video visibility correctly, you might have forgotten. More infos : https://github.com/fawazahmed0/youtube-uploader#youtube-setup');
}

return uploadedLink
}