youtube-validate
It validates wether a given url or id are valid youtube videos. Based on the youtube-validator module.
how to install
npm install youtube-validate
what is valid and invalid url/id?
- valid url/id are all strings that do match with an existent youtube video url or id, depending on the function called. ex:
var validUrl1 = 'youtube.com/watch?v=2XH5_qafR8k'var validUrl2 = 'www.youtube.com/watch?v=2XH5_qafR8k'var validUrl3 = 'http://www.youtube.com/watch?v=2XH5_qafR8k'var validUrl4 = 'www.YOUTUBE.COM/watch?v=2XH5_qafR8k'var validID = '2XH5_qafR8k'
- invalid url/id are the same as above, but on the other way around. ex:
var invalidUrl1 = 'random_stuff_here'var invalidUrl2 = 'www.youtube.com/'var invalidUrl3 = 'www.youtube.com'var invalidUrl44 = 'www.youtube.com/watch?v=2XH5_qafR8k' //video ids are case sensitivevar invalidID = 'id_that_does_not_exist'
how to use
//..
//..validator // a standard youtube id