mirror of
https://github.com/spotipy-dev/spotipy.git
synced 2026-04-26 16:15:51 +03:00
[GH-ISSUE #177] Get list of tracks in a playlist #90
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#90
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 @lohriialo on GitHub (Mar 30, 2017).
Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/177
How to get each track and artist from 'top_tracks'
@lohriialo commented on GitHub (Mar 30, 2017):
Here's how I got to the track names/artists but it's very dirty, I would love to clean it up
example a single track has multiple artist, hence when looping, number of artists is greater than number of tracks. Therefore, in case of a track with multiple artist, I want to concatenate the two/'three or more artist into one string, so that number of tracks = number of artist
@bentappin commented on GitHub (Mar 31, 2017):
Well, depends what you want the output to be really!
You could replace the inner loop with something like this:
artist_names.append(', '.join([a['name'] for a in track_names_data['artists']]))@lohriialo commented on GitHub (Mar 31, 2017):
Exactly what I wanted, small web app running beautifully here http://spotipy.herokuapp.com/
Thanks much!!