--- title: "This Site No Longer Spies for Youtube" categories: - blog abstract: Linking to YT in place of embeding is better for page load sped date: 2023-02-02T14:58:42+01:00 year: 2023 draft: false --- This site no longer spies for google Say what you will about Youtube; it is the de facto webpage for video content. Unfortunately, there is much to say, primarily negative, but more on this later. Today I want to make this blog a bit better. Let's use [Google](https://pagespeed.web.dev/report?url=https%3A%2F%2Fmichal.sapka.me%2F2023%2Fcradle-of-filth-her-ghost-in-the-fog%2F) to analyze the performance of [one of my recent posts](/2023/cradle-of-filth-her-ghost-in-the-fog/). It's terrible. Not as awful as it would have been if I used a lot of JS, but it is terrible, nevertheless. Here are the findings. Notice a pattern? {{< img-center "23-gsa-opportunities.png" "Opportunities">}} {{< img-center "23-gsa-diagnostics.png" "Diagnostics">}} Yeah. I embed YouTube videos, and even Google says it's a bad idea. What adds insult to injury is [Privacy Badger](https://privacybadger.org) screaming at me on my own page. So yup, I have joined the botnet and spied for Google. There are two solutions: pretend that YouTube doesn't exist or fix it. Let's fix it. The idea: use hyperlinks with self-hosted thumbnails. Sounds simple. And it is simple. Step 1 - get all Youtube embeds. This site is powered by [Hugo](https://gohugo.io/), and all three embeds are done via a `youtube` shortcode. So, on posts, I add a ``` ``` Let's use GNU to get all video ids! ``` grep -r "}}