Closed barbhackk closed 5 years ago
The available thumbnails are in info.player_response.videoDetails.thumbnail.thumbnails
. It's what I personally have been using to get the video thumbnail. (The last element of the array will always have the thumbnail with "higher" resolution, which isn't actually the highest res YouTube has, it's still a very small image, but I'm afraid that's the best we can get.
I'm not sure if this URL always works or if it will keep working but... if you need the maximum resolution thumbnail you can try getting it from https://img.youtube.com/vi/${videoID}/maxresdefault.jpg
, replacing ${videoID}
with the id of the video, eg: https://img.youtube.com/vi/FgeRDFai3C4/maxresdefault.jpg or also https://i.ytimg.com/vi/FgeRDFai3C4/maxresdefault.jpg
Note: This might not work for all videos, as we've seen in issue #155. And some resolutions might include black bars.
The available thumbnails are in
info.player_response.videoDetails.thumbnail.thumbnails
. It's what I personally have been using to get the video thumbnail. (The last element of the array will always have the thumbnail with "higher" resolution, which isn't actually the highest res YouTube has, it's still a very small image, but I'm afraid that's the best we can get.I'm not sure if this URL always works or if it will keep working but... if you need the maximum resolution thumbnail you can try getting it from
https://img.youtube.com/vi/${videoID}/maxresdefault.jpg
, replacing${videoID}
with the id of the video, eg: https://img.youtube.com/vi/FgeRDFai3C4/maxresdefault.jpg or also https://i.ytimg.com/vi/FgeRDFai3C4/maxresdefault.jpgNote: This might not work for all videos, as we've seen in issue #155. And some resolutions might include black bars.
Thanks @BrunoMoreira99 it's works now.
@BrunoMoreira99 Thanks a lot
Hi,
I think YouTube has updated its code ! Indeed since this morning I can not manage to recover the thumbnail of video.
I use the latest ytdl-core.
My package.json :
When I try to get thumbnail with:
In console I have : "undefined"
See this demo : https://repl.it/repls/DentalLightyellowOop
Looking a little I saw that the thumbnail was in the node "player-response" (
console.log(info.player-response)
)But we can not access it.
Thanks for your help,
Barbhackk