From 9ffabc2b4bfd273aa9e90e5488fa456b16401762 Mon Sep 17 00:00:00 2001 From: Dominic Findlay Date: Wed, 30 Aug 2023 00:42:34 +0100 Subject: [PATCH] Upload actually isn't finished when value = 100, change to look for Upload Complete. --- src/upload.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/upload.ts b/src/upload.ts index c47662a..02fa460 100644 --- a/src/upload.ts +++ b/src/upload.ts @@ -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') @@ -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)