# YouTube URIs fail to render thumbnails when oneboxed

**URL:** https://meta.discourse.org/t/youtube-uris-fail-to-render-thumbnails-when-oneboxed/387673
**Category:** Bug
**Tags:** composer, onebox
**Created:** [November 5, 2025, 2:07pm UTC](https://meta.discourse.org/t/youtube-uris-fail-to-render-thumbnails-when-oneboxed/387673 "2025-11-05T14:07:47Z")
**Posts on this page:** 1
**Showing post:** 13

<div class="post-metadata">

### Author: ![martin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/martin/32/491371_2.png) [@martin](https://meta.discourse.org/u/martin)
#### Post date: [November 11, 2025, 6:49am UTC](https://meta.discourse.org/t/youtube-uris-fail-to-render-thumbnails-when-oneboxed/387673/13 "2025-11-11T06:49:13Z")

</div>

Okay I think I have a fix here, we should use oEmbed for this stuff from YouTube instead:

[https://github.com/discourse/discourse/pull/35959](https://github.com/discourse/discourse/pull/35959)

> [@ted](#):
>
> Oneboxes do use a browser user agent, so maybe they just honour that and say: “Cool. You don’t need OpenGraph then”?

I don’t think so, it seems like 2 things:

1. Some sort of weird IP rate limiting/redirection, because _sometimes_ for different sites on our hosting the OP link works
2. This code no longer working, because the JSON that we expect is no longer there [discourse/lib/onebox/engine/youtube\_onebox.rb at e144ec07c8c17ad0f73427524bccc10c074d5a19 · discourse/discourse · GitHub](https://github.com/discourse/discourse/blob/e144ec07c8c17ad0f73427524bccc10c074d5a19/lib/onebox/engine/youtube_onebox.rb#L31-L40)

Overall the oEmbed URL seems safer, for the OP video it’s `https://www.youtube.com/oembed?url=https://youtube.com/shorts/Cs3sTnLO6EE&format=json` and you get this kind of response:

 ![image](https://global.discourse-cdn.com/meta/original/4X/e/9/d/e9d7a844887d7a1d47b4d5815abc1c7f735139b3.png)

---

_[View the full topic](https://meta.discourse.org/t/youtube-uris-fail-to-render-thumbnails-when-oneboxed/387673)._
