From c2e343651ba1df801532501259705bec80b0d5c3 Mon Sep 17 00:00:00 2001 From: Kiko Beats Date: Fri, 2 Sep 2022 09:13:06 +0200 Subject: [PATCH] fix: ensure spotify URL is valid --- src/index.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/index.js b/src/index.js index 9109dab..4182397 100644 --- a/src/index.js +++ b/src/index.js @@ -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 })