Is there a way to detect in the backend (js/nodejs) if a video url is no longer available?

I have a table with hundreds of free video links of youtube.com and other streaming sites, which I embed in my site.
I periodically check manually if they are still available.
Is there a way to check them through programming in javascript (in the backend) or nodejs?
I do now how would the routine be constructed, but I am missing how to do the check automatically.
I don’t mean how to check if an url has a valid ‘format’, I am asking how to check if the formerly validated url is still currently avaliable.
I hope someone knows, thanks.

I have found how to validate if an url has a valid format.
I have not found how to check if an url formerly validated, is currently valid.