mirror of
https://github.com/spotipy-dev/spotipy.git
synced 2026-04-26 16:15:51 +03:00
[GH-ISSUE #382] Trying to pull artist of a specific track based on search query #224
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#224
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 @innovatetom on GitHub (Jun 10, 2019).
Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/382
Hi, I am new to Python and I'm trying to make a tool that will tell me if a track is explicit based on the search query. It is working as I'd hoped but I want to also print the artist of the track.
At the moment, It prints the name of the track, and if the track is explicit. It also prints '[{'external_urls': {'spotify': 'https://open.spotify.com/artist/7dGJo4pcD2V6oG8kP0tJRR'}, 'href': 'https://api.spotify.com/v1/artists/7dGJo4pcD2V6oG8kP0tJRR', 'id': '7dGJo4pcD2V6oG8kP0tJRR', 'name': 'Eminem', 'type': 'artist', 'uri': 'spotify🧑🎨7dGJo4pcD2V6oG8kP0tJRR'}]'
For the artist.
I'd like to pull the artist name out of this if possible without the full json result.
My code is below:
@stephanebruckert commented on GitHub (Jan 11, 2020):
There can be multiple artists, so you need to select the one at index 0: