Specify optional param in enumerate()

This commit is contained in:
Ritiek Malhotra
2018-01-25 19:30:16 +05:30
committed by GitHub
parent 8fd28c81ae
commit d624bbb3d5

View File

@@ -72,10 +72,10 @@ def grab_list(text_file):
pass pass
log.info(u'Preparing to download {} songs'.format(len(lines))) log.info(u'Preparing to download {} songs'.format(len(lines)))
for number, raw_song in enumerate(lines): for number, raw_song in enumerate(lines, 1):
print('') print('')
try: try:
grab_single(raw_song, number=number+1) grab_single(raw_song, number=number)
# token expires after 1 hour # token expires after 1 hour
except spotipy.client.SpotifyException: except spotipy.client.SpotifyException:
# refresh token when it expires # refresh token when it expires