Skip to content

Commit

Permalink
fix: ensure spotify URL is valid
Browse files Browse the repository at this point in the history
  • Loading branch information
Kikobeats committed Sep 2, 2022
1 parent 5b32f11 commit c2e3436
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,7 @@ const createGetData = fetch => async (url, opts) => {
Buffer.from(decodeURIComponent(script.children[0].content), 'base64')
).data.entity
// they removed/renamed some things, which for backwards compatibility we need to add back
data.external_urls = {
spotify: 'https://open.spotify.com/track/' + data.uri
}
data.external_urls = { spotify: spotifyURI.formatOpenURL(data.uri) }
data.release_date = data.releaseDate.isoString
data.audio = data.audioPreview.url
return normalizeData({ data })
Expand Down

0 comments on commit c2e3436

Please sign in to comment.