bluesky-social / social-app

The Bluesky Social application for Web, iOS, and Android
https://bsky.app
MIT License
9.16k stars 1.19k forks source link

Non-English Spotify URLs will not result in an embedded Spotify player #2357

Closed tkusano closed 9 months ago

tkusano commented 9 months ago

Bluesky can now embed Spotify players, but non-English version links to Spotify albums and tracks will not work as embeded player.

To Reproduce

Samples URLs are attached.

track

album

(If you open a Spotify URL in a language you do not use in your browser, you will be redirected to the Spotify URL in the language you use.)

Cause

In src/lib/strings/embed-player.ts, spotify URL is split by '/' and the second element is treated as type, and expected to be one of 'playlist', 'album' or 'track'.

However, if the second element is in the form of 'intl-LANGCODE', then the third element must be treated as 'type'.

const [_, type, id] = urlp.pathname.split('/')
haileyok commented 9 months ago

Screenshot 2023-12-31 at 2 05 02 AM

Assuming this is correct? Spotify seems to redirect to the non-localized version whenever I try to access it, so I can't actually verify...(doesn't seem the embed takes in the locale either that I can tell)