-
Notifications
You must be signed in to change notification settings - Fork 97
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
downloading playlists #61
Comments
after some research, I've found out that spotify changed the API for playlists in 2018: https://developer.spotify.com/community/news/2018/06/12/changes-to-playlist-uris/ and after some more digging, I've found out that the handling of the uris is being done by libspotify, which is deprecated. Unfortunatly my python is not the best, but I might ask someone I know who could maybe help to fix the handling of the spotify playlist uris. Doesn't seem too complicated |
With the help of Spotipy (https://github.com/plamere/spotipy), I've created a little script, which returns the track uris of a playlist. It's a fine workaround for me right now, I just paste the track uris into a file, and let spotify-ripper do the rest.
|
@arthurkoch your code doesn't account for a large playlist, you'll need to handle the case where the number of tracks exceeds the limit. This code will continue to hit the API until there are no more in the playlist. def get_track_uris_from_playlist(playlist_uri):
client = spotipy.Spotify(client_credentials_manager=SpotifyClientCredentials())
track_uris = []
# initial fetch
results = client.playlist_tracks(playlist_uri, limit=100)
for track in results['items']:
track_uris.append(track['track']['uri'])
# pagination next calls
while results and results['next']:
results = client.next(results)
for track in results['items']:
track_uris.append(track['track']['uri'])
return track_uris |
@enkoder Currently I'm using https://github.com/kmille/deezer-downloader, which is working very well. It also accepts Spotify Playlists. |
Hey,
is there a workaround for downloading playlists?
The actual spotify uri format for playlists is: spotify:playlist:0SyciLmBQVD3POK0jTD4BW
but the format spotify-ripper wants is like this: spotify:user:username:playlist:4vkGNcsS8lRXj4q945NIA4
thanks in advance
The text was updated successfully, but these errors were encountered: