fawazahmed0 / youtube-uploader

Free youtube video uploader with no limits
MIT License
331 stars 80 forks source link

waiting for file chooser failed: timeout 60000ms exceeded #69

Open grenadil opened 2 years ago

grenadil commented 2 years ago

UnhandledPromiseRejectionWarning: TimeoutError: waiting for waiting for file chooser failed: timeout 60000ms exceeded at Object.waitWithTimeout (/app/node_modules/puppeteer/lib/cjs/puppeteer/common/helper.js:224:26) 2021-11-17T02:09:27.466319+00:00 app[worker.1]: at Page.waitForFileChooser (/app/node_modules/puppeteer/lib/cjs/puppeteer/common/Page.js:269:14) 2021-11-17T02:09:27.466320+00:00 app[worker.1]: at runMicrotasks () 2021-11-17T02:09:27.466321+00:00 app[worker.1]: at processTicksAndRejections (internal/process/task_queues.js:95:5) 2021-11-17T02:09:27.466321+00:00 app[worker.1]: (Use node --trace-warnings ... to show where the warning was created) 2021-11-17T02:09:27.466358+00:00 app[worker.1]: (node:4) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1) 2021-11-17T02:09:27.466361+00:00 app[worker.1]: (node:4) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Followed all the setup steps and got this

TentacleSama4254 commented 2 years ago

Can you show the code you used when you got this error

IGuessBlue commented 2 years ago

I've been getting the same error. It worked before, but now just doesn't anymore. I've tried using an older version, but that doesn't seem to work either. Even when using code similar to your example code it doesn't work.

Here's my code:

const credentials = {
    email: '***',
    pass: '***',
    recoveryemail: '***'
}

const youtube = require('youtube-videos-uploader');

async function uploadVideo(){
    let video = { 
        path: `${__dirname}/video.mp4`, 
        title: 'video title', 
        description: 'video description', 
        thumbnail: `${__dirname}/thumbnail.png`, 
        language: 'english', 
        tags: ['video', 'thumbnail'],  
        onSuccess: suc => {console.log(`success: ${suc}`)}, 
        onProgress: (progress) => {console.log('progress:', progress)} 
    }
    youtube.upload(credentials, [video]).then(console.log)
}
uploadVideo();

Edit: code highlighting

jollyassjerk commented 2 years ago

Same issue, on a headless raspberry pi.

const uplvid = { 
    path: 'final/output.mp4',
    title: req.body.title,
    description: desc,    
    language: 'english',
    tags: ['video', 'some','tags'],
    onSuccess: (videoUrl) => {
      console.log("success!" + videoUrl) ;      
    },
    skipProcessingWait: true,
    onProgress: (progress) => { 
      console.log('progress:' + progress) ;      
    } 
  }
  upload(credentials, [uplvid], {headless:true, executablePath: '/usr/bin/chromium-browser'}).then(console.log);

update - using a series of headless puppeteer screenshots, I discovered what I believe the problem was (for me). When the youtube account is brand new, and nothing has been uploaded, on the upload page (youtube.com/upload) there is this silly dialog preventing the file upload button. image

I'm not really experienced enough with puppeteer or npm modules to make an edit, but I think that somewhere around line 104 of https://github.com/fawazahmed0/youtube-uploader/blob/main/src/upload.ts you can add a button click on the button with class .ytcp-warm-welcome-dialog to dismiss it?

The workaround for me was to dismiss it and upload anything, and then youtube uploader doesn't get stuck on it, and then success!

IGuessBlue commented 2 years ago

@jollyassjerk This indeed seems to be the problem. Your solution works for me, thanks a lot!

This issue should definitely be addressed like you proposed.

nathanael540 commented 6 months ago

The same here! But I don't believe that's the message. I believe the error occurs when sending the cover image.

But I couldn't take a screenshot of the screen to check. Could anyone shed some light on this?