Need help with importing util
Hi, noob here.
I need to import util so I can use the validateLink function. The documentation is a bit unclear for me.
In the beginning I tried to simply do const ytdl = require('ytdl-core') with ytdl.validateLink(url), that didn't work. Then, I tried to const {util} = require('ytdl-core') and util.validateLink(url), which didn't work either.
What is the proper way to import util? Thanks in advance!
Not your mistake, the readme clearly says validateLink() but apparently it's validateId() according to this line.
const ytdl = require('ytdl-core')
ytdl.validateId(url);
@fent Either the readme or index.js should be updated accordingly.
This still doesn't seem to work for some reason. Keep getting the same error.
Uncaught TypeError: ytdl.validateId is not a function
And I am using it in the exact same way that you are.
guess that one is on me... gonna make a pr real quick try updating ytdl-core @JamesTiberiusKirk , u may still be on an older version