1.0.0 • Published 4 years ago
get-yt-thumbnail v1.0.0
get-yt-thumbnail
An util to get thumbnail uses YouTube video ID.
usage
getYtThumbnail(videoId, thumbType)
videoId(required) Any YouTube IDthumbType(optional) Get less than or equal to the size this.maxresdefault.jpgsddefault.jpghqdefault.jpgmqdefault.jpgdefault.jpg
import getYtThumbnail from 'get-yt-thumbnail';
(async () => {
// Get the largest size.
const video = await getYtThumbnail('Any YouTube ID');
console.log(video);
// Get the largest size under sddefault.jpg.
const video2 = await getYtThumbnail('Any YouTube ID', 'sddefault.jpg');
console.log(video2);
})();1.0.0
4 years ago