Working notes on why YouTube embeds in blog posts don’t reliably show up in
RSS/Atom feed readers, what’s been tried, and what the research says as of
August 2026. Written up so this doesn’t have to be re-investigated from
scratch next time this comes up. See also the open investigation in
docs/rss-migration-plan.md.
src/components/video/YouTube.astro is a custom component (not an Astro
built-in) built during a short experiment on 2025-10-03/04, contained
entirely to the draft src/pages/drafts/verticalvideo2.mdx. It has never
been used in a single published post — every real post with a video
(mudfun.md, dune.astro, designsprint.astro, musicforchores.astro)
hardcodes a raw <iframe> directly in the content instead.
The component has a forFeed prop, wired up via Astro’s
compiledContent({ components: { YouTube: ... } }) override in both
rss.xml.js and feeds/main.astro — but since no real post uses the
<YouTube> component, that override currently has nothing to intercept.
Raw iframes pass through into feed output completely untouched.
Important correction: forFeed does not swap the video for a
thumbnail-and-link fallback. It still renders a real <iframe> — the only
thing it changes is the embed domain: youtube-nocookie.com (used on the
website) becomes plain youtube.com for the feed. See below for why that
distinction turned out to matter, and why it’s not a full fix either way.
Why nocookie on the website specifically: at the time, the
youtube-nocookie.com embed had a more minimal player UI than the regular
youtube.com embed. Worth re-checking whether that’s still true — YouTube
changes embed UI periodically.
Full agent report is not reproduced verbatim here — this is the distilled version.
Do feed readers render or strip iframes? It’s genuinely per-reader, not standardized:
<iframe> by default (XSS defense),
then some add back a narrow allowlist of trusted embed domains — YouTube
being the most common exception.youtube-nocookie.com embeds in its
sanitizer — one of the few readers confirmed to prefer the nocookie
domain.referrerpolicy attribute broke rendering), and requires the
reader to manually allow the domain in privacy settings — not automatic.Does youtube.com vs youtube-nocookie.com actually matter? Yes, this
is real, not folklore — but it cuts both directions. Some sanitizers
(Miniflux) explicitly prefer the nocookie domain; others (a common
DOMPurify pattern seen in the wild, FreshRSS’s manual-allow requirement)
are written against the plain youtube.com domain specifically and would
silently drop a nocookie embed unless someone extended the allowlist. There
is no universal answer — it depends entirely on each reader’s own
hand-written allowlist.
What’s the standard fallback? A thumbnail image linking out to the
video, not an iframe at all. This is what feed-generation tools
(e.g. WP RSS Aggregator) commonly do by default, and the W3C Feed Validator
flags <iframe> inside content:encoded as a warning specifically because
of inconsistent reader support. A YouTube thumbnail needs no API key:
https://i.ytimg.com/vi/{id}/hqdefault.jpg, wrapped in a link to
https://www.youtube.com/watch?v={id}.
main-static.htmlRan /feeds/main and /feeds/main-static through Granary’s live Atom
conversion to check the mudfun videos directly. As expected, /feeds/main
(sourced from the live mudfun.md) carries the raw <iframe> straight
through into the Atom <content> untouched — confirms the diagnosis above
empirically, not just theoretically.
But /feeds/main-static — the old hand-maintained static file, restored as
main-static.html — does not have the raw iframe for either mudfun
video. It already has exactly the thumbnail+link fallback the research
above recommends as the standard practice:
<a href="https://www.youtube.com/watch?v=4jV1f4xQNO4" style="display: inline-block; margin: 1rem 0;">
<img src="https://img.youtube.com/vi/4jV1f4xQNO4/maxresdefault.jpg" alt="Cleaning mud off the bicycle - Watch on YouTube" style="width: auto; height: 200px; display: block; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 4px;" loading="lazy">
</a>
<p style="margin-top: 0.5rem; font-size: 0.85em; color: rgba(255,255,255,0.6); font-style: italic;">(<a href="https://www.youtube.com/watch?v=4jV1f4xQNO4">Watch on YouTube</a>)</p>
So this was already solved by hand at some point while building the static
prototype — it just never got backported into mudfun.md itself (still
raw iframes there) or generalized into YouTube.astro/rss.xml.js. This
markup is a ready-made template for whatever the eventual fix looks like —
no need to design the fallback from scratch, just decide how to wire it in
(hand-edit the two posts directly vs. building it as a real fallback path
in the YouTube component/feed generators).
forFeed to use youtube.com instead of youtube-nocookie.com
is a narrow, unreliable workaround — it helps only the subset of readers
whose allowlist happens to prefer the plain domain, and does nothing for
readers that strip all iframes outright (which appears to be most of
them, absent specific enrichment like Feedbin’s).main-static.html, see above.mudfun.md first published
(2025-10-23) — it’s a pre-existing, already-live gap, not something any
recent branch work introduced. Not a blocker for anything else; a
standalone task whenever there’s appetite for it.