mirror of
https://github.com/spotipy-dev/spotipy.git
synced 2026-04-26 16:15:51 +03:00
[GH-ISSUE #932] Get embed links? #556
Labels
No labels
api-bug
bug
dependencies
documentation
duplicate
enhancement
external-ide
headless-mode
implicit-grant-flow
invalid
missing-endpoint
pr-welcome
private-api
pull-request
question
spotipy3
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/spotipy#556
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @dsm-72 on GitHub (Jan 22, 2023).
Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/932
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
Using BeautifulSoup to get data from Spotify is very annoying (even when using selenium) because data (e.g. playlist songs) is dynamically rendered based on intersection observers. So this library is a nice way to get all songs in a given playlist. However, they only have external links, not embedded links. It would be cool to be able, given a playlist or a list of tracks, to get the corresponding embed links.
Describe the solution you'd like
A clear and concise description of what you want to happen.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Selenium + Spotipy to go to the track page and click the corresponding buttons to get the embed link.
Additional context
Add any other context or code about the feature request here.
@dieser-niko commented on GitHub (Jan 22, 2023):
I'm not sure if it's Spotipy's job to convert a track ID into an embed link, and so I don't think such a function will be implemented. However, you can create such a function yourself. An embed link is very easy to create:
https://open.spotify.com/embed/track/<track_id>. So with that you could write a function like this:You could also remove things like the
spotify:track:prefix from the track_id, but that's up to you.@stephanebruckert commented on GitHub (Jan 23, 2023):
You can definitely construct an embed yourself. Note this would be the responsibility of a front-end app rather than back-end app, so probably out of scope for both spotipy or the Spotify API. For example if using react you could use https://www.npmjs.com/package/react-spotify-embed