Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/#7 parse mobile links #9

Merged
merged 8 commits into from
Oct 19, 2023
Merged

Feat/#7 parse mobile links #9

merged 8 commits into from
Oct 19, 2023

Conversation

sjdonado
Copy link
Owner

@sjdonado sjdonado commented Oct 19, 2023

Thanks to this hint from the description of #7

Unfortunately, after that it's not as simple as updating the fetch call to fetch(spotifyLink, { redirect: 'follow' }) as it redirects to a page that tries to open the app or show a button with a link to the correct URL. (I would use a[href^=https://open.spotify.com to get this)

this issue was addressed in no time :)

This PR updates parseSpotifyMetadata, to check if the link has the mobile format and then execute one extra request to get the desktop link (which is the only one that returns the required metadata).

The api/search endpoint has also been updated to validate the API version and the HTTP GET verb has been replaced by POST to support spotify links with query params.

Coverage is virtually 100%, so I'm confident that we can merge without side effects.

closes #7

@sjdonado sjdonado merged commit 1ce83dc into master Oct 19, 2023
1 check passed
@sjdonado sjdonado deleted the feat/#7-parse-mobile-links branch October 19, 2023 21:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Doesn't work with mobile links
1 participant