# 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:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![roke\_julian\_lockhart](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/roke_julian_lockhart/32/540179_2.png) [@roke\_julian\_lockhart](https://meta.discourse.org/u/roke_julian_lockhart)
#### Post date: [November 5, 2025, 2:07pm UTC](https://meta.discourse.org/t/youtube-uris-fail-to-render-thumbnails-when-oneboxed/387673/1 "2025-11-05T14:07:47Z")

</div>

I’ve confirmed that:

1. [`https://youtube.com/shorts/Cs3sTnLO6EE`](https://youtube.com/shorts/Cs3sTnLO6EE)

2. [`https://www.youtube.com/watch?v=Cs3sTnLO6EE&lc=Ugyi1VtrCVd2POTc82N4AaABAg#:~:text=A%20Screencast%20Of%20LinkedIn%20Persona%20Verification%20Failure`](https://www.youtube.com/watch?v=Cs3sTnLO6EE&lc=Ugyi1VtrCVd2POTc82N4AaABAg#:~:text=A%20Screencast%20Of%20LinkedIn%20Persona%20Verification%20Failure)

…become a transparent box:

| Shorts | Non-Shorts |
| --- | --- |
| ![](https://global.discourse-cdn.com/meta/original/4X/1/1/b/11b7761c52d8adb2884470645e6331817e0f4c66.png) \[1\] | ![](https://global.discourse-cdn.com/meta/original/4X/3/8/2/382e5ade2a49f0bf1e28c78ae8d438fc5e409f2c.png) \[1:1\] |

The DOM shows:

> ```HTML
> <img src="" width="480" height="360" title=" - YouTube" style="aspect-ratio: 480 / 360;">
> 
> ```

However, they render when posted:

[![](https://global.discourse-cdn.com/meta/original/4X/b/a/9/ba9df0af3ceaae483889955f1d6b969dabe5c8c8.jpeg "A Screencast Of LinkedIn Persona Verification Failure") ](https://www.youtube.com/watch?v=Cs3sTnLO6EE)

* * *

1. [`bugs.kde.org/show_bug.cgi?id=511477#c1`](https://bugs.kde.org/show_bug.cgi?id=511477#c1:~:text=2025%2D11%2D03%2021:06:27%20GMT-,Duplicates%20https://bugs.kde.org/show_bug.cgi?id=510982%23c2.,-***%20This%20bug)

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [November 6, 2025, 12:19am UTC](https://meta.discourse.org/t/youtube-uris-fail-to-render-thumbnails-when-oneboxed/387673/2 "2025-11-06T00:19:05Z")

</div>

Confirmed, nice catch, going to put a pr-welcome on this for now and leave a note for the team to triage.

---

<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 6, 2025, 6:37am UTC](https://meta.discourse.org/t/youtube-uris-fail-to-render-thumbnails-when-oneboxed/387673/4 "2025-11-06T06:37:40Z")

</div>

This is an interesting one, I can reproduce the issues with the links in the OP here on Meta, but locally and on our internal Discourse site they are fetched and rendered fine:

 ![image](https://global.discourse-cdn.com/meta/original/4X/3/a/a/3aaabe1470c84e0bf7effc50981aa580941f8fad.jpeg)

@roke_julian_lockhart are these links not rendering properly on your own site, or just not here on Meta?

---

<div class="post-metadata">

### Author: ![roke\_julian\_lockhart](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/roke_julian_lockhart/32/540179_2.png) [@roke\_julian\_lockhart](https://meta.discourse.org/u/roke_julian_lockhart)
#### Post date: [November 6, 2025, 3:44pm UTC](https://meta.discourse.org/t/youtube-uris-fail-to-render-thumbnails-when-oneboxed/387673/5 "2025-11-06T15:44:43Z")

</div>

> [@martin](#):
>
> Are these links not rendering properly on your own site, or just not here on Meta?

@martin, _some_ others, too:

#### Non-Shorts

With [`https://www.youtube.com/watch?v=Cs3sTnLO6EE&lc=Ugyi1VtrCVd2POTc82N4AaABAg#:~:text=A%20Screencast%20Of%20LinkedIn%20Persona%20Verification%20Failure`](https://www.youtube.com/watch?v=Cs3sTnLO6EE&lc=Ugyi1VtrCVd2POTc82N4AaABAg#:~:text=A%20Screencast%20Of%20LinkedIn%20Persona%20Verification%20Failure), this reproduces at:

1. 
#### [`discuss.kde.org/new-topic`](https://discuss.kde.org/)

 ![](https://global.discourse-cdn.com/meta/original/4X/b/0/7/b07e282cdb997433ed4d612ede1b2ef24a03b5f3.png) \[1\]

2. 
#### [`forum.fairphone.com/new-topic`](https://forum.fairphone.com/new-topic)

 ![](https://global.discourse-cdn.com/meta/original/4X/6/1/a/61a5025a59c8e2b43ebd4625cc84be535981f846.png) \[1:1\]

However, at [`discussion.fedoraproject.org`](https://discussion.fedoraproject.org/new-topic), it renders:

 ![@{'Date'='20251106T154007+0000'; 'Type'='Photo'; 'Origin'='Fedora Discussion - Fedora Linux and Fedora Project community conversation. — Mozilla Firefox'}#](https://global.discourse-cdn.com/meta/original/4X/c/2/e/c2e0ab4ae9300bd6cef5ce440678d0e1f3530b13.png) \[1:2\]

#### Shorts

> ****
>
> With [`https://youtube.com/shorts/Cs3sTnLO6EE`](https://youtube.com/shorts/Cs3sTnLO6EE), the undermentioned is reproduced:
> 
> > [@Youtube links don't show preview anymore](https://meta.discourse.org/t/youtube-links-dont-show-preview-anymore/159755/1):
> >
> > our forum doesn’t show the preview image on a Youtube video anymore. It only shows a link that
> 
> …at:
> 
> 1. 
> #### [`discuss.kde.org/new-topic`](https://discuss.kde.org/)
> 
> ![](https://global.discourse-cdn.com/meta/original/4X/3/3/7/3379de6477d1a7017a68aa6655c4d11c8eb7029e.png) \[1:3\]
> 
> 2. 
> #### [`forum.fairphone.com/new-topic`](https://forum.fairphone.com/new-topic)
> 
> ![](https://global.discourse-cdn.com/meta/original/4X/8/9/e/89eea15f4f76a91d6625844fc0ecf7e5fa3e6eb6.png) \[1:4\]
> 
> However, as before, at [`discussion.fedoraproject.org`](https://discussion.fedoraproject.org/new-topic), it renders:
> 
> ![@{'Date'='20251106T154119+0000'; 'Type'='Photo'; 'Origin'='Fedora Discussion - Fedora Linux and Fedora Project community conversation. — Mozilla Firefox'}#](https://global.discourse-cdn.com/meta/original/4X/f/3/4/f344acfdbe0afc5c56ae4f29d07f8929df30a324.jpeg) \[1:5\]

What are Fedora doing so correctly?

* * *

1. [`bugs.kde.org/show_bug.cgi?id=511477#c1`](https://bugs.kde.org/show_bug.cgi?id=511477#c1:~:text=2025%2D11%2D03%2021:06:27%20GMT-,Duplicates%20https://bugs.kde.org/show_bug.cgi?id=510982%23c2.,-***%20This%20bug)

---

<div class="post-metadata">

### Author: ![hameedacpa](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hameedacpa/32/520681_2.png) [@hameedacpa](https://meta.discourse.org/u/hameedacpa)
#### Post date: [November 7, 2025, 9:45am UTC](https://meta.discourse.org/t/youtube-uris-fail-to-render-thumbnails-when-oneboxed/387673/6 "2025-11-07T09:45:23Z")

</div>

Is this issue solved, I opened a topic for issue similar currently going in my Board

> [@I have issue to embed Youtube video - YouTube Error 153](https://meta.discourse.org/t/i-have-issue-to-embed-youtube-video/387672/2):
>
> this is my topic link

---

<div class="post-metadata">

### Author: ![roke\_julian\_lockhart](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/roke_julian_lockhart/32/540179_2.png) [@roke\_julian\_lockhart](https://meta.discourse.org/u/roke_julian_lockhart)
#### Post date: [November 7, 2025, 10:04am UTC](https://meta.discourse.org/t/youtube-uris-fail-to-render-thumbnails-when-oneboxed/387673/7 "2025-11-07T10:04:45Z")

</div>

@hameedacpa, this is completely irrelevant to that, because this is about the previewer. Additionally, you can confirm that it’s not been remediated by merely utilising the previewer. I suggest that you install a translator.

---

<div class="post-metadata">

### Author: ![hameedacpa](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hameedacpa/32/520681_2.png) [@hameedacpa](https://meta.discourse.org/u/hameedacpa)
#### Post date: [November 7, 2025, 11:45am UTC](https://meta.discourse.org/t/youtube-uris-fail-to-render-thumbnails-when-oneboxed/387673/8 "2025-11-07T11:45:55Z")

</div>

I found this topic including partial issue that I’m facing too

 ![image](https://global.discourse-cdn.com/meta/original/4X/1/1/c/11c2ac9ba57690b028a107b40af972b1021e54b1.png)

Actually all Youtube videos not working like before and my forums is not having a customization as it is based on the original board

---

<div class="post-metadata">

### Author: ![roke\_julian\_lockhart](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/roke_julian_lockhart/32/540179_2.png) [@roke\_julian\_lockhart](https://meta.discourse.org/u/roke_julian_lockhart)
#### Post date: [November 7, 2025, 11:59am UTC](https://meta.discourse.org/t/youtube-uris-fail-to-render-thumbnails-when-oneboxed/387673/9 "2025-11-07T11:59:51Z")

</div>

@hameedacpa, thanks. That is similar, although I doubt equivalent. The presence of an invalid thumbnail icon appears to demonstrate that, alongside the different aspect ratio of the `<img`. If you put those details in `387672/1`, they’ll be of use there. If they’re merely browser-caused differences, it’ll be triaged as a partial duplicate of this.

On that note, include your browser version, Discourse version, and the actual markup of the rendered content in that cited thread. Currently, it’s devoid of much except a screenshot, and spread over immediately consecutive posts; you need to put the effort in to make it presentable, to receive unpaid assistance.

---

<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 10, 2025, 7:20am UTC](https://meta.discourse.org/t/youtube-uris-fail-to-render-thumbnails-when-oneboxed/387673/10 "2025-11-10T07:20:21Z")

</div>

Something is messing up in our Onebox flow here, I think to do with redirection/FinalDestination. If I use `curl` like so:

```plaintext
curl -L https://youtube.com/shorts/Cs3sTnLO6EE

```

I am able to find the `title` and other `meta` tags in the response:

```plaintext
curl -L https://youtube.com/shorts/Cs3sTnLO6EE | htmlq 'head > meta'
  % Total % Received % Xferd Average Speed Time Time Time Current
                                 Dload Upload Total Spent Left Speed
  0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 947221 0 947221 0 0 406174 0 --:--:-- 0:00:02 --:--:-- 504109
<meta content="IE=edge" http-equiv="X-UA-Compatible">
<meta content="ApvK67ociHgr2egd6c2ZjrfPuRs8BHcvSggogIOPQNH7GJ3cVlyJ1NOq/COCdj0+zxskqHt9HgLLETc8qqD+vwsAAABteyJvcmlnaW4iOiJodHRwczovL3lvdXR1YmUuY29tOjQ0MyIsImZlYXR1cmUiOiJQcml2YWN5U2FuZGJveEFkc0FQSXMiLCJleHBpcnkiOjE2OTUxNjc5OTksImlzU3ViZG9tYWluIjp0cnVlfQ==" http-equiv="origin-trial">
<meta content="rgba(255, 255, 255, 0.98)" name="theme-color">
<meta content="A Screencast Of LinkedIn Persona Verification Failure" name="title">
<meta content="For https://www.linkedin.com/help/linkedin/cases/73171318#:~:text=Thanks%20for%20contacting%20us%20about,to%20troubleshoot%20any%20additional%20causes." name="description">
...

```

```plaintext
 curl -L https://youtube.com/shorts/Cs3sTnLO6EE | htmlq 'head > title'
  % Total % Received % Xferd Average Speed Time Time Time Current
                                 Dload Upload Total Spent Left Speed
  0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 992110 0 992110 0 0 445530 0 --:--:-- 0:00:02 --:--:-- 739941
<title>A Screencast Of LinkedIn Persona Verification Failure - YouTube</title>

```

However when I get the response via our oneboxer code, these are the only tags (except script + style ones) I get in the `<head>` :

```plaintext
uri = FinalDestination.new("https://youtube.com/shorts/Cs3sTnLO6EE", Oneboxer.get_final_destination_options("https://youtube.com/shorts/Cs3sTnLO6EE")).resolve
doc2 = Onebox::Helpers.fetch_response(uri)
Nokogiri.HTML(doc2).css("head").children.each do |headel|
  next if headel.name == "script" || headel.name == "style"
  puts headel.to_s
end; nil;

<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta http-equiv="origin-trial" content="ApvK67ociHgr2egd6c2ZjrfPuRs8BHcvSggogIOPQNH7GJ3cVlyJ1NOq/COCdj0+zxskqHt9HgLLETc8qqD+vwsAAABteyJvcmlnaW4iOiJodHRwczovL3lvdXR1YmUuY29tOjQ0MyIsImZlYXR1cmUiOiJQcml2YWN5U2FuZGJveEFkc0FQSXMiLCJleHBpcnkiOjE2OTUxNjc5OTksImlzU3ViZG9tYWluIjp0cnVlfQ==">
<link rel="shortcut icon" href="https://www.youtube.com/s/desktop/ace6261e/img/favicon.ico" type="image/x-icon">
<link rel="icon" href="https://www.youtube.com/s/desktop/ace6261e/img/favicon_32x32.png" sizes="32x32">
<link rel="icon" href="https://www.youtube.com/s/desktop/ace6261e/img/favicon_48x48.png" sizes="48x48">
<link rel="icon" href="https://www.youtube.com/s/desktop/ace6261e/img/favicon_96x96.png" sizes="96x96">
<link rel="icon" href="https://www.youtube.com/s/desktop/ace6261e/img/favicon_144x144.png" sizes="144x144">
<link rel="stylesheet" href="//fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&amp;family=YouTube+Sans:wght@300..900&amp;display=swap" nonce="kFtYVVw9wWKkoPdOJkO9xQ">
<link rel="stylesheet" href="/s/player/65578ad1/www-player.css" nonce="kFtYVVw9wWKkoPdOJkO9xQ">
<link rel="stylesheet" href="https://www.youtube.com/s/desktop/ace6261e/cssbin/www-main-desktop-player-skeleton.css" nonce="kFtYVVw9wWKkoPdOJkO9xQ">
<link rel="stylesheet" href="https://www.youtube.com/s/desktop/ace6261e/cssbin/www-onepick.css" nonce="kFtYVVw9wWKkoPdOJkO9xQ">
<link rel="stylesheet" href="https://www.youtube.com/s/_/ytmainappweb/_/ss/k=ytmainappweb.kevlar_base.dsnGl9m3_bM.L.X.O/am=AAAgAAgk/d=0/rs=AGKMywEVyAGSU99VwQpoLFio5FrCvZ1WpA" nonce="kFtYVVw9wWKkoPdOJkO9xQ">
<meta name="theme-color" content="rgba(255, 255, 255, 0.98)">
<link rel="search" type="application/opensearchdescription+xml" href="https://www.youtube.com/opensearch?locale=en_US" title="YouTube">
<link rel="manifest" href="/manifest.webmanifest" crossorigin="use-credentials">
<link rel="canonical" href="undefined">
<link rel="alternate" media="handheld" href="https://m.youtube.com/shorts/Cs3sTnLO6EE">
<link rel="alternate" media="only screen and (max-width: 640px)" href="https://m.youtube.com/shorts/Cs3sTnLO6EE">
<title> - YouTube</title>
<meta name="title" content="">
<meta name="description" content="Enjoy the videos and music you love, upload original content, and share it all with friends, family, and the world on YouTube.">
<meta name="keywords" content="video, sharing, camera phone, video phone, free, upload">
<link rel="alternate" href="android-app://com.google.android.youtube/http/www.youtube.com/shorts/Cs3sTnLO6EE">
<link rel="alternate" href="ios-app://544007664/vnd.youtube/www.youtube.com/shorts/Cs3sTnLO6EE">

```

I thought maybe this `ignore_redirects` was causing it, but if I modify the FD options it made no difference:

> <https://github.com/discourse/discourse/blob/087665ef4716f2f019e485aad91825a59bb2e780/lib/oneboxer.rb#L26-L31>

I suspect YouTube is probably cutting down on scraping because they are having the same AI scraper problem as everyone else, but not sure what specifically is causing us to get the blank response (that looks like it gets meta/title tags populated via JS the same as if you visit in the browser).

This code here for youtube oneboxing is what is expecting the title + image tags to be populated:

> <https://github.com/discourse/discourse/blob/087665ef4716f2f019e485aad91825a59bb2e780/lib/onebox/engine/youtube_onebox.rb#L52-L61>

Will keep investigating 👀

---

<div class="post-metadata">

### Author: ![ted](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ted/32/283882_2.png) [@ted](https://meta.discourse.org/u/ted)
#### Post date: [November 10, 2025, 7:29am UTC](https://meta.discourse.org/t/youtube-uris-fail-to-render-thumbnails-when-oneboxed/387673/12 "2025-11-10T07:29:12Z")

</div>

> [@martin](#):
>
> the same as if you visit in the browser

Could be that they are only shipping what looks necessary to save bandwidth? Our Oneboxes do use a browser user agent, so maybe they just honour that and say: “Cool. You don’t need OpenGraph then”?

---

<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)

---

<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 12, 2025, 5:19am UTC](https://meta.discourse.org/t/youtube-uris-fail-to-render-thumbnails-when-oneboxed/387673/14 "2025-11-12T05:19:52Z")

</div>

Okay with that fix merged, this is working now 🙂

[![](https://global.discourse-cdn.com/meta/original/4X/e/0/5/e05d3c1661f7f0051aa4a8a0dfe5fe17772f74d2.jpeg "A Screencast Of LinkedIn Persona Verification Failure") ](https://www.youtube.com/watch?v=Cs3sTnLO6EE)

Note that onebox URL responses are cached for 1 day, I had to do this in the console `Oneboxer.preview(“https://youtube.com/shorts/Cs3sTnLO6EE”, invalidate_oneboxes: true)` to see the new result.

---

<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 14, 2025, 10:00pm UTC](https://meta.discourse.org/t/youtube-uris-fail-to-render-thumbnails-when-oneboxed/387673/16 "2025-11-14T22:00:12Z")

</div>

This topic was automatically closed after 2 days. New replies are no longer allowed.
