node-ytdl-core: ERR_INVALID_ARG_TYPE(name, 'string', value)

I switched from ytdl(…) to ytdl.downloadFromInfo and suddenly i got an error like this:

How can i catch this?

internal/validators.js:112
     throw new ERR_INVALID_ARG_TYPE(name, 'string', value);
     ^
 TypeError [ERR_INVALID_ARG_TYPE]: The "url" argument must be of type string. Received type undefined
     at validateString (internal/validators.js:112:11)
     at Url.parse (url.js:155:3)
     at Object.urlParse [as parse] (url.js:150:13)
     at doDownload (/var/www/.../node_modules/miniget/dist/index.js:90:28)
     at processTicksAndRejections (internal/process/task_queues.js:75:11) {
   code: 'ERR_INVALID_ARG_TYPE'
 }

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 4
  • Comments: 20 (10 by maintainers)

Commits related to this issue

Most upvoted comments

Sure, it is from getInfo().

I forgot to mention that this happen only 1:100 and not with the same video so i don’t know if we really need to fix this. But i need to catch it. 😃