# Bad inline onebox title for Spotify album shares

**URL:** https://meta.discourse.org/t/bad-inline-onebox-title-for-spotify-album-shares/377753
**Category:** Bug
**Tags:** onebox
**Created:** [August 7, 2025, 5:08pm UTC](https://meta.discourse.org/t/bad-inline-onebox-title-for-spotify-album-shares/377753 "2025-08-07T17:08:53Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![supermathie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/supermathie/32/507518_2.png) [@supermathie](https://meta.discourse.org/u/supermathie)
#### Post date: [August 7, 2025, 5:08pm UTC](https://meta.discourse.org/t/bad-inline-onebox-title-for-spotify-album-shares/377753/1 "2025-08-07T17:08:54Z")

</div>

The title for an inline onebox is bad (not that I’m saying it’s our fault):

https://open.spotify.com/embed/album/1nrWysWdrgPR0kBJ45z2aS?si=FurcwGpfSrWJBPGwKeCvDQ&utm_source=oembed

Inline: [Spotify](https://open.spotify.com/album/1nrWysWdrgPR0kBJ45z2aS?si=FurcwGpfSrWJBPGwKeCvDQ)

source:

```plaintext
https://open.spotify.com/album/1nrWysWdrgPR0kBJ45z2aS?si=FurcwGpfSrWJBPGwKeCvDQ

Inline: https://open.spotify.com/album/1nrWysWdrgPR0kBJ45z2aS?si=FurcwGpfSrWJBPGwKeCvDQ

```

image (preview):

> ![image](https://global.discourse-cdn.com/meta/original/4X/2/9/d/29de0098760431e81cf8880425fbdfbf1eb18c71.jpeg)

image (baked):

> ![image](https://global.discourse-cdn.com/meta/original/4X/a/8/6/a86671d59eb1d025476e5bb9aee747b65495c5ef.png)

---

<div class="post-metadata">

### Author: ![awesomerobot](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/awesomerobot/32/142900_2.png) [@awesomerobot](https://meta.discourse.org/u/awesomerobot)
#### Post date: [August 7, 2025, 9:05pm UTC](https://meta.discourse.org/t/bad-inline-onebox-title-for-spotify-album-shares/377753/2 "2025-08-07T21:05:03Z")

</div>

Do we need to update the browser version in the user agent our crawler is using? looks like we’re using Safari 14?

Visiting the URL manually in that Safari version:

 ![image](https://global.discourse-cdn.com/meta/original/4X/d/1/7/d175e9f9bf4ae5d206e49f232900bf1c2f2557e5.jpeg)

---

<div class="post-metadata">

### Author: ![supermathie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/supermathie/32/507518_2.png) [@supermathie](https://meta.discourse.org/u/supermathie)
#### Post date: [August 7, 2025, 10:31pm UTC](https://meta.discourse.org/t/bad-inline-onebox-title-for-spotify-album-shares/377753/3 "2025-08-07T22:31:54Z")

</div>

> [@awesomerobot](#):
>
> Do we need to update the browser version in the user agent our crawler is using? looks like we’re using Safari 14?

We’re not consistent with user agents.

For the full onebox we use:

```plaintext
Discourse Forum Onebox v3.5.0.beta9-dev

```

and Spotify is fine with this and serves the full page:

```plaintext
○ → curl -s --user-agent 'Discourse Forum Onebox v3.5.0.beta9-dev' 'https://open.spotify.com/album/1nrWysWdrgPR0kBJ45z2aS?si=FurcwGpfSrWJBPGwKeCvDQ' | htmlq 'meta[property^="og:description"], meta[property^="og:site_name"], title'
<title>The First Symphony - Album by Indecent | Spotify</title>
<meta content="Spotify" property="og:site_name">
<meta content="Indecent · Album · 2024 · 12 songs" property="og:description">
<meta content="Spotify" property="og:site_name">

```

but for the inline onebox we use:

```plaintext
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0 Safari/605.1.15

```

So that’s ultimately why we’re getting different behaviour, though I would still ask why we don’t use the opengraph properties here? Spotify is still serving those up despite being an unsupported browser:

```plaintext
○ → curl -s --user-agent 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0 Safari/605.1.15' 'https://open.spotify.com/album/1nrWysWdrgPR0kBJ45z2aS?si=FurcwGpfSrWJBPGwKeCvDQ' | htmlq 'meta[property^="og:description"], meta[property^="og:site_name"], title'
<title>Unsupported browser</title>
<meta content="Spotify" property="og:site_name">
<meta content="Indecent · Album · 2024 · 12 songs" property="og:description">
<meta content="Spotify" property="og:site_name">

```

> **all properties**
>
> ```plaintext
> ○ → curl -s --user-agent 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0 Safari/605.1.15' 'https://open.spotify.com/album/1nrWysWdrgPR0kBJ45z2aS?si=FurcwGpfSrWJBPGwKeCvDQ' | htmlq 'meta[property^="og:"]'
> <meta content="Spotify" property="og:site_name">
> <meta content="The First Symphony" property="og:title">
> <meta content="Indecent · Album · 2024 · 12 songs" property="og:description">
> <meta content="https://open.spotify.com/album/1nrWysWdrgPR0kBJ45z2aS" property="og:url">
> <meta content="music.album" property="og:type">
> <meta content="Spotify" property="og:site_name">
> <meta content="AR" property="og:restrictions:country:allowed">
> …
> <meta content="XK" property="og:restrictions:country:allowed">
> <meta content="https://i.scdn.co/image/ab67616d0000b273ff9434b9650f38d183e91fb1" property="og:image">
> 
> ```

---

<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: [August 11, 2025, 3:01am UTC](https://meta.discourse.org/t/bad-inline-onebox-title-for-spotify-album-shares/377753/4 "2025-08-11T03:01:23Z")

</div>

> [@supermathie](#):
>
> So that’s ultimately why we’re getting different behaviour, though I would still ask why we don’t use the opengraph properties here?

Hmmm:

> <https://github.com/discourse/discourse/blob/b1e2ac3cc8007f193ad6e89eb25d38c49eea9e64/lib/retrieve_title.rb#L35-L47>

Because `<title>` takes precedence over open graph in our implementation and we don’t want to hardcode the string “Unsupported browser”…

[FIX: update final destination to use more recent user agent by SamSaffron · Pull Request #34207 · discourse/discourse · GitHub](https://github.com/discourse/discourse/pull/34207) should fix this…

This feels way old though:

`DEFAULT_USER_AGENT = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0 Safari/605.1.15"`

---

<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: [August 12, 2025, 10:04pm UTC](https://meta.discourse.org/t/bad-inline-onebox-title-for-spotify-album-shares/377753/7 "2025-08-12T22:04:59Z")

</div>

hmmm… now spotify give us the title “spotify” :slight_smile: we are going to need custom “spotify” code :frowning: if we want to get the album name.
