Skip to content

Commit c2e3436

Browse files
committed
fix: ensure spotify URL is valid
1 parent 5b32f11 commit c2e3436

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/index.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,7 @@ const createGetData = fetch => async (url, opts) => {
4747
Buffer.from(decodeURIComponent(script.children[0].content), 'base64')
4848
).data.entity
4949
// they removed/renamed some things, which for backwards compatibility we need to add back
50-
data.external_urls = {
51-
spotify: 'https://open.spotify.com/track/' + data.uri
52-
}
50+
data.external_urls = { spotify: spotifyURI.formatOpenURL(data.uri) }
5351
data.release_date = data.releaseDate.isoString
5452
data.audio = data.audioPreview.url
5553
return normalizeData({ data })

0 commit comments

Comments
 (0)