Use the fact [] is a falsy value

master
David Fischer 2015-05-16 12:35:37 +00:00
parent 9e130dc94c
commit a06be61c74
1 changed files with 1 additions and 1 deletions

View File

@ -222,7 +222,7 @@ def download_all_user_tracks(user):
data = response.read()
text = data.decode('utf-8')
json_data = json.loads(text)
while str(json_data) != '[]':
while json_data:
offset += 1
try:
this_url = json_data[0]['track']['uri']