Auto-generate Youtube thumbnail URL

Hello,

Is there a way inside the Glide data editor (not in GS) to automatically generate the thumbnail URL from a Youtube link, perhaps using the template and generate URL columns?

i.e. I want to automatically turn

into

Thanks!

1 Like

Sure. Assuming you know the YouTubeID then you can create 2x template columns as follows:

URL for the video:
https://www.youtube.com/embed/{YTID}

URL for the thumbnail:
https://img.youtube.com/vi/{YTID}/0.jpg

In both cases {YTID} is the YouTube ID.

Hope that helps

6 Likes

You can use a template column replacing the video_id

4 Likes

Same question with a twist – if you have the video ID, how can you get at the:

  • video duration
  • description
  • number of views

I see in reading around the topic that you need a YouTube API key (I got that setup) which you do NOT need for the image thumbnail or the RSS feed).

I would like to get at the data in either GSheets or in Glide (this is for my son’s project “YouTube for Kids”).

Thanks!

1 Like

You can try this.

2 Likes

I don’t have the Youtube ID, I have the URL.

So the solution I’m looking needs to be able to extract that prior to any of those steps.

I’m aware of this.

But as I mentioned in my original post I need to do it from the Youtube link.

To be clear, the Video ID is not given.

The crux of the issue is being able to extract that ID from the Youtube link inside the Glide data table.

It might be possible, but I can almost guarantee you that it won’t be pretty.
Without any string manipulation functions in the GDE, any solution that succeeds with this sort of task is going to be a nasty kludge.

This is a case where I’d probably resort to a GSheet formula, and just live with the sync delay (I assume that’s why you are looking for a way to do it in Glide?)

3 Likes

Okay, thanks for your input!

If it doesn’t make sense to achieve it in Glide then GS would be fine. I wanted to know if it was possible/easy.

Could you point me to a thread, or let me know yourself if you can, of the simplest array formula that can achieve this?

Thanks again!

Maybe this…

Worth noting however that YouTube URL’s come in a variety of formats, and from a quick look the solution offered in that post may not deal with all of them.

Here’s a Stackoverflow thread that’s worth a read…

3 Likes

You could probably create a basic text column, but don’t fill it with anything. So an empty column. Then create a template column that’s pointed to the url column and replaces any parts that don’t contain the video id with the empty column. The end result should be the id that can be used to build the url for the image.

As an alternative, you could create a template column pointing to the url column and instead of replacing non-id parts of the url with an empty value, you directly replace the non-id parts with the parts of a url required for the image url. This will require separate template columns with partial urls to use for the replacements.

3 Likes

In Google Sheets, Copy this formula to get the ID.
=ARRAYFORMULA(IF(LEN(A2:A)=0, MID(A2:A,33,11)))

A2:A is the youtube URL column.

I’m fetching statistics of 300 Videos daily via apps script.
Also, I’ve set a trigger that is running every 3 hours.

It can fetch Thumbnails, Title, Description, total views, total comments, total likes/dislikes, timestamps.

If you’re interested to get the script, let me know.

5 Likes

Nice one :point_up: I’m interested in seeing the script (if possible) thanks :blush:

1 Like

Hi Guys, I realized there is actually a pre-programed feature now, to get the thumbnail from a YouTube video! In the native spreadsheet editor, make a new column, choose type “column type->image->YouTube Thumbnail”

1 Like

Yeah, it has been added recently.

1 Like

I am interested too.
Thanks

1 Like

@Nadir_Abdelrahman_MD Just use the built in column type as indicated above.

1 Like