[SOLVED] BOUNTY (10USD): Generate thumbnails from Vimeo 🤑

Hello everyone :smiley:

I am pulling data from Google Spreadsheets and one of the columns is the Vimeo’s video ID.
Based on this video ID, during middleman deploy process, I would like to get thumbnail URL of this video, so I can display it on my website, that won’t be saved anywhere other than to the ready “source” file and pushed online to my server.

I guess I will need a simple helper that will sit in config.rb file. Here are plenty of ways to pull the thumbnail URL:

I will pay 10USD for a solution (PayPal).

Help!

Any reason to not link to the thumbnails on vimeo? This would avoid the complexity around saving the file and linking to the local file.

Also, wouldn’t you want to also link to the video? Or, are you only displaying thumbnails without the purpose to play the video?

A useful helper IMO would: display the thumbnail and link to the video on vimeo or on a dedicated embed page./popup.

I would love to but Vimeo only provide that option if you subscribe to their PRO plan.

I already link to a video and let the user play them on my website since it’s pretty straight-forward - just include ID of video you want to display after vimeo.com/ URL.

Would you try this: https://gist.github.com/andreimoment/7eeea30785c6bd85743975dce8ed4a0d

Worked for me, and the thumbnails showed do not belong to a vimeo pro account.

The thumbnail links are directly to the vimeo cdn: https://i.vimeocdn.com/video/664919165_640.jpg (from this video https://vimeo.com/241359441 )

Hey Andrei,

When I put “dry” number of any Vimeo’s video ID, it works well, but when I try to call it from my the snapshot of the spreadsheet middleman deploy command is generating, I am getting:

ArgumentError at /
Vimeo Thumbnail Error: Vimeo ids may only contain digits! You provided:
Ruby	/Users/evo/Sites/MYWEBSITE.com/lib/custom_helpers.rb: in vimeo_thumbnail_url, line 29
Web	GET 127.0.0.1/

So, in a shortcut, this works in my view (HAML):

%img.product-card-media{src: "#{vimeo_thumbnail("241359441")}"}

But this doesn’t (and that’s how I call the video ID in my view - I loop over the videos and display one by one):
%img.product-card-media{src: "#{vimeo_thumbnail(video.id_vimeo)}"}

UPDATE: I made it work - you are a legend!
Sent you a PM with a question about your PayPal email so I can paypal you the money.

P.S. Is there a way I can specify custom thumbnail size?

to specify the size:

vimeo_thumbnail_url(vimeo_id, :large)

you may use :large, :small and :medium. These are the sizes provided by vimeo.

If you omit the parameter, it will use the large size.

The issue was that somehow you were passing an empty string instead of a valid vimeo id. Seems like you resolved that already.

Right, but can I define a custom size, outside of these :large :medium and :small parameters?

P.S. Money sent! Please check your PayPal and confirm :slight_smile:

No, you can’t define custom size beyond the built vimeo thumbnail sizes via the script. You could probably use CSS to do that.

Got the $10, thank you.