lastfm-backup/samples/getTracks.py

20 lines
433 B
Python
Raw Normal View History

2016-10-19 14:04:20 +03:00
#!/usr/bin/env python3
2016-10-22 13:43:33 +03:00
import lastfm_backup as lfm
2016-10-19 14:04:20 +03:00
API_KEY = '0'
USERNAME = 'admin'
2016-10-19 14:04:20 +03:00
if __name__ == '__main__':
pages = lfm.get_pages(USERNAME, API_KEY)
count = 0
2016-10-19 14:04:20 +03:00
for page in range(1, pages + 1):
tracks = lfm.get_scrobbles(USERNAME, API_KEY, page)
for track in tracks:
print('%s - %s' % (track['artist']['#text'], track['name'],))
count = count + 1
print('\nTotal scrobbling tracks: %d' % count)