fix pagination

This commit is contained in:
Dima Gerasimov 2017-05-13 00:19:37 +01:00
parent ac05aad045
commit ac867f425b

View File

@ -23,7 +23,7 @@ def get_scrobbles(username, api_key, page):
response = json.loads(urllib.request.urlopen( response = json.loads(urllib.request.urlopen(
'http://ws.audioscrobbler.com/2.0/' 'http://ws.audioscrobbler.com/2.0/'
'?method=user.getrecenttracks&user={0}&api_key={1}&format=json' '?method=user.getrecenttracks&user={0}&api_key={1}&format=json'
'&limit=200'.format(username, api_key) '&limit=200&page={2}'.format(username, api_key, page)
).read().decode("utf8"))['recenttracks']['track'] ).read().decode("utf8"))['recenttracks']['track']
return(response) return(response)