Last active
February 13, 2018 13:28
-
-
Save xeBuz/4389610 to your computer and use it in GitHub Desktop.
Get artists and tracks w/playcounts form Lastfm user.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python2 | |
# -*- coding: utf-8 -*- | |
import pylast | |
api_key = '189c5354198342a01be847e595afbb14' | |
username = 'eikiu' | |
api = pylast.LastFMNetwork(api_key = api_key) | |
user = pylast.User(username, api) | |
library = user.get_library() | |
for artist in library.get_artists(): | |
print artist.item.name + " (" + str(artist.playcount) +")" | |
tracks = library.get_tracks(artist = artist.item.name, limit=None) | |
for track in tracks: | |
print "\t" + track.item.title + " - plays: " + str(track.playcount) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment