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

Upload actually isn't finished when value = 100, change to look for Upload Complete. #225

Merged
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
5 changes: 3 additions & 2 deletions src/upload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,9 @@ async function uploadVideo(videoJSON: Video, messageTransport: MessageTransport)
throw new Error('Youtube returned an error : ' + errorMessage)
}

// Wait for upload to complete
// Wait for upload to complete, but not checks
const uploadCompletePromise = page
.waitForXPath('//tp-yt-paper-progress[contains(@class,"ytcp-video-upload-progress-hover") and @value="100"]', {
.waitForXPath('//ytcp-video-upload-progress/span[contains(@class,"progress-label") and contains(text(),"Upload complete")]', {
timeout: 0
})
.then(() => 'uploadComplete')
Expand All @@ -211,6 +211,7 @@ async function uploadVideo(videoJSON: Video, messageTransport: MessageTransport)

// Wait for upload to go away and processing to start, skip the wait if the user doesn't want it.
if (!videoJSON.skipProcessingWait) {
// waits for checks to be complete (upload should be complete already)
await page.waitForXPath('//*[contains(text(),"Video upload complete")]', { hidden: true, timeout: 0 })
} else {
await sleep(5000)
Expand Down