Garmaine Staff asked 1 year ago

I'm trying to make a custom JS for my WordPress to force Highest Quality Thumbnails for Youtube videos.

I found the Regex : https:\/\/\/vi\/(?:.+).jpg$

The example url should go from***/hqdefault.jpg


So the script needs to follow these steps:

1- Find all the Youtube Thumbnails (Regex Matching)
2- Replace hqdefault.jpg with maxresdefault.jpg and apply the change to the HTML

I tried for +24hours, but couldn't get the puzzle together… Thank you for helping out !