Announcements

Help Wizard

Step 1

NEXT STEP

How to see through shortened https://spotify.link/ links

How to see through shortened https://spotify.link/ links

Recently Spotify changed share links from the classic "https://open.spotify.com/track..album..user..etc/id" to a shortened URL "https://spotify.link/randomString".

There's no way to see through this link, and you can't use fetch on the URL to see where it redirects to, so users aren't able to paste in links to our service, and they're not tech-savvy enough to get the originating URL.

My only thinking right now is a headless browser and following that way, but that's a HUGE implementation.

 

On mobile especially, there's no way to get a tracks/albums/users ID, just this new shortened share URL which breaks everything.

 

Any ideas here?

Reply
4 Replies

No ideas. Also just noticed it. But I wouldn't hope that anything would change.

The "is_playable" parameter in the Get Track request has not been returned correctly for 4 weeks. No one is going to fix it.

And a short link, I believe, is forever. Because no one reads the forum from those who could fix it.
And a couple of weeks ago everything was correct.

The only way I've gotten around this is doing a GET on the opaque link so I can read the HTML. This may not work for everyone since I tested this on my computer which has the desktop app installed, but my HTML response body includes the following div:

            <div class="sub-heading">
                We have redirected you to the desktop app.
                </br>
                You can also <a class="secondary-action"
                    href="https://open.spotify.com/track/0RM0BeXRRIz1LExEl83GhA?si=FCAOOxnhTueTrAbOwn3x0w&utm_source=copy-link&utm_medium=copy-link&nd=1&_branch_match_id=1236116524762470129&_branch_referrer=H4sIAAAAAAAAA8soKSkottLXLy7IL8lMq9TLyczL1rcozDcwTclzLnJJAgBpSYS%2BIAAAAA%3D%3D">open
                    this link in your browser.</a>
            </div>

So I can use my regex parsing on the HTML body to extract the track ID like I have been before. Hope this helps folks. 

This was the solution for me. I used jsdom in Node to parse the response's HTML and grab the link from there. 

Suggested posts