Get a youtube thumbnails
$ npm install youtube-thumbnails
call the module
const youthumb = require('youtube-thumbnails');
Get all the available youtube thumbnails for a given id.
The id from the youtube video you want a thumbnail from.
like "dlte2Mfg614" from https://www.youtube.com/watch?v=dlte2Mfg614
return an object, thumbnails, with all the links.
youthumb.all('dlte2Mfg614', (thumbnails) => {
console.log(thumbnails);
});
{
default: 'https://i.ytimg.com/vi/dlte2Mfg614/default.jpg',
medium: 'https://i.ytimg.com/vi/dlte2Mfg614/mqdefault.jpg',
high: 'https://i.ytimg.com/vi/dlte2Mfg614/hqdefault.jpg',
standard: 'https://i.ytimg.com/vi/dlte2Mfg614/sddefault.jpg',
maxres: 'https://i.ytimg.com/vi/dlte2Mfg614/maxresdefault.jpg'
}
Get a single youtube thumbnail link in the quality you specify.
The id from the youtube video you want a thumbnail from.
like "la9C0n7jSsI" from https://www.youtube.com/watch?v=la9C0n7jSsI
The quality on the youtube picture.
return an error if there was an error else it return a thumbnail link.
youthumb.get('la9C0n7jSsI', 'maxres', (err, thumbnail) => {
if (err)
console.log(err);
else {
console.log(thumbnail);
}
});
https://i.ytimg.com/vi/la9C0n7jSsI/maxresdefault.jpg
MIT