From 51649e236464e9480b6c142a70427a38caf84517 Mon Sep 17 00:00:00 2001 From: Kaj Forney Date: Mon, 27 Feb 2023 12:57:43 -0700 Subject: [PATCH] Fetch YouTube thumbnails in WebP format. --- index.html | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/index.html b/index.html index 3f4e098..ac14fd9 100644 --- a/index.html +++ b/index.html @@ -455,8 +455,7 @@ let youtube = document.querySelectorAll(".youtube-video"); for (let i = 0; i < youtube.length; i++) { - - let source = "https://img.youtube.com/vi/" + youtube[i].dataset.embed + "/maxresdefault.jpg"; + let source = "https://i.ytimg.com/vi_webp/" + youtube[i].dataset.embed + "/maxresdefault.webp"; let image = new Image(); image.src = source; @@ -475,8 +474,6 @@ this.innerHTML = ""; this.appendChild(iframe); }); - - }