mirror of
https://github.com/spotipy-dev/spotipy.git
synced 2026-04-27 00:25:54 +03:00
[GH-ISSUE #472] Is there a way to get the time a track was added to a playlist? #277
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#277
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 @eliasbenb on GitHub (Apr 14, 2020).
Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/472
Just as the title says, is there a way to get the time a track was added to a playlist? Any help is appreciated. Also this library is amazing!
I'm looking for a port of this: https://developer.spotify.com/documentation/web-api/reference/playlists/reorder-playlists-tracks/
@stephanebruckert commented on GitHub (Apr 14, 2020):
Hi @eliasbenb,
Any field you see in the official Spotify web-api doc should be returned by spotipy. I can see a field called
added_atin https://developer.spotify.com/documentation/web-api/reference-beta/#category-playlistsFeel free to close the issue if that answers your question!
@eliasbenb commented on GitHub (Apr 14, 2020):
Ok, sorry, but I've been trying to use the
added_attag but I can't get it to work.This is the code I've been using:
print(playlist_tracks['items']['added_at'])I'm trying to print the time a track in a playlist was added, I get this output:print(playlist_tracks['items']['added_at']) TypeError: list indices must be integers or slices, not strThis is my full code:
@stephanebruckert commented on GitHub (Apr 14, 2020):
Use
pprintto print the content of your variables:Is
added_atin there?@eliasbenb commented on GitHub (Apr 16, 2020):
OK, I was able to get this working by using this. Thank you for your help.