Created
January 23, 2023 21:07
-
-
Save omar2205/c7e83c9fd6e6a7d2e483736ad27e04f1 to your computer and use it in GitHub Desktop.
Get YouTube video thumbnails
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getThumbnails(videoId) { | |
const thumbnails = {} | |
const baseUrl = `https://img.youtube.com/vi/${videoId}/` | |
thumbnails.maxresdefault = `${baseUrl}maxresdefault.jpg` | |
thumbnails.hqdefault = `${baseUrl}hqdefault.jpg` | |
thumbnails.mqdefault = `${baseUrl}mqdefault.jpg` | |
thumbnails.default = `${baseUrl}default.jpg` | |
return thumbnails | |
} | |
export default getThumbnails |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment