Luuk-Dev / YT-Stream

Create easily readable streams from YouTube video url's
MIT License
23 stars 4 forks source link

Crash when getting age restricted videos #7

Closed frostzzone closed 1 year ago

frostzzone commented 1 year ago
node:internal/process/promises:246
          triggerUncaughtException(err, true /* fromPromise */);
          ^

[UnhandledPromiseRejection: 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(). The promise rejected with the reason "Error while getting video url
Sign in to confirm your age".] {
  code: 'ERR_UNHANDLED_REJECTION'
}

is there any way to catch this error/prevent it without setting a cookie?


edit: i found out how to fix lines 91 - 93 in src/stream/createstream.js need to be caught

frostzzone commented 1 year ago

I have sent pr a fix in #8

Luuk-Dev commented 1 year ago

I've just merged your pull request on Github, I'll release a new version within a few minutes. Have a nice day!