yt-embed icon indicating copy to clipboard operation
yt-embed copied to clipboard

Support different image formats

Open LinqLover opened this issue 3 years ago • 4 comments

I have made a video in a portrait format and would like to display the thumbnail in the same format. Something like an URL parameter for cropping the preview image would be a great addition!

LinqLover avatar Mar 15 '21 00:03 LinqLover

@LinqLover Can you please post an easy to replicate scenario? i.e. sample video, actual & expected output.

mhasbini avatar Mar 15 '21 09:03 mhasbini

Sorry, probably "format" was the wrong terminus. I was referring to the aspect ratio of images. Take an arbitrary portrait mode from YouTube and the thumbnail will still have a landscape ratio - it would be nice if you could use a URL like https://yt-embed.herokuapp.com/embed?v=3BYNj6Yvl8I&w=1080&h=1920, or just &res=portrait, or something similar. Just an idea :)

LinqLover avatar Mar 16 '21 16:03 LinqLover

I added a change in https://github.com/0xbsec/yt-embed/commit/351066318b421d4e4f7f68707e59bcb24dc76217 so that you'll be able to specify which image format you need:

https://yt-embed.herokuapp.com/embed?v=DrI2lUXL1no&img=0

List of formats: https://stackoverflow.com/questions/2068344/how-do-i-get-a-youtube-video-thumbnail-from-the-youtube-api

Please let me know if this solve you issue.

mhasbini avatar Jun 17 '21 17:06 mhasbini

Thank you, so there is no possibility to retrieve a portrait-mode thumbnail?

LinqLover avatar Jun 17 '21 17:06 LinqLover