Created
January 30, 2020 15:31
-
-
Save alexander-elgin/342ac498607ae9606dea238e32c19ed3 to your computer and use it in GitHub Desktop.
YouTube 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
const getThumbnails = (videoUrl) => { | |
const videoId = videoUrl.replace('https://www.youtube.com/watch?v=', ''); | |
return ['hqdefault', 'mqdefault', 'maxresdefault'].map(size => `https://img.youtube.com/vi/${videoId}/${size}.jpg`); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment