Fetch YouTube thumbnails in WebP format.

This commit is contained in:
Kaj Forney 2023-02-27 12:57:43 -07:00
parent e27f2747c5
commit 51649e2364
Signed by: kforney
GPG key ID: 3AB4E2E04CEF656F

View file

@ -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);
});
}