YouTube Thumbnail URL

YouTube Thumbnail URL

For
From
Facebook
Status
Updating
Share
💡
Using the thumbnail URL: when in a table view you can double click on the formula result to highlight it and then copy and paste that URL directly into a page or into a File & media property's Embed link field.

Thumbnail URL

if(test(prop("Video URL"), "youtube.com/|youtu.be/"), "https://img.youtube.com/vi/" + if(contains(prop("Video URL"), "youtube"), replace(replace(prop("Video URL"), ".+?(v=)", ""), "&(.*)", ""), if(contains(prop("Video URL"), "youtu.be"), replace(replace(prop("Video URL"), ".+?(e/)", ""), "[?](.*)", ""), "")) + "/maxresdefault.jpg", "")
Explanation
if(test(prop("Video URL"), "youtube.com/|youtu.be/"),
Check to see if Video URL contains either youtube.com/ or youtu.be/. If it does do the following.
"https://img.youtube.com/vi/" +
Include the start of the YouTube thumbnail URL.
if(contains(prop("Video URL"), "youtube.com"),
Check to see if Video URL contains youtube. If it does do the following.
replace(replace(prop("Video URL"), ".+?(v=)", ""), "&(.*)", ""),
First, match everything up to and including v= and replace it with nothing. Secondly, match everything after and including & and replace it with nothing. This will leave you with the video ID, such as oTahLEX3NXo
if(contains(prop("Video URL"), "youtu.be"),
If Video URL doesn't contain youtube then check to see if it contains youtu.be instead. If it does do the following.
replace(replace(prop("Video URL"), ".+?(e/)", ""), "[?](.*)", ""),
First, match everything up to and including e/ and replace it with nothing. Secondly, match everything after and including ? and replace it with nothing. This will leave you with the video ID, such as oTahLEX3NXo
+ "/maxresdefault.jpg",
Include the end of the YouTube thumbnail URL.
"")
If Video URL contains neither youtube.com/ or youtu.be/ then display nothing.
 
By Ben  •  Latest  •  Was this helpful? Please consider buying me a coffee. Cheers!By Ben  •  Latest  •  Was this helpful? Please consider buying me a coffee. Cheers!
By BenLatest • Was this helpful? Please consider buying me a coffee. Cheers!