Nov-22-2017, 07:33 PM
To be honest how you have done this is bad
To break it down to make make it easier test.
Here 3 album id,not 598(do you really need this before going on further?).
See that url work(past in browser),so can delete this two lines.
i have stop here.
Quote:The issue seems to be in the 3rd part, on getting tracks info of the albums.Then it should be at least 3 function.
To break it down to make make it easier test.
Here 3 album id,not 598(do you really need this before going on further?).
import requests api_key = "b088cbedecd40b35dd89e90f55227ac2" albums =\ {100: {'ID': 100, 'artist': 'David Bowie', 'artistID': 0, 'name': 'Best of Bowie', 'url': 'https://www.last.fm/music/David+Bowie/Best+of+Bowie'}, 101: {'ID': 101, 'artist': 'David Bowie', 'artistID': 0, 'name': 'Hunky Dory', 'url': 'https://www.last.fm/music/David+Bowie/Hunky+Dory'}, 102: {'ID': 102, 'artist': 'David Bowie', 'artistID': 0, 'name': "Let's Dance", 'url': 'https://www.last.fm/music/David+Bowie/Let%27s+Dance'}} tracks = {} for i, v in albums.items(): print(i, v)
Output:100 {'ID': 100, 'artist': 'David Bowie', 'artistID': 0, 'name': 'Best of Bowie', 'url': 'https://www.last.fm/music/David+Bowie/Best+of+Bowie'}
101 {'ID': 101, 'artist': 'David Bowie', 'artistID': 0, 'name': 'Hunky Dory', 'url': 'https://www.last.fm/music/David+Bowie/Hunky+Dory'}
102 {'ID': 102, 'artist': 'David Bowie', 'artistID': 0, 'name': "Let's Dance", 'url': 'https://www.last.fm/music/David+Bowie/Let%27s+Dance'}
So now is easier to see what going on.See that url work(past in browser),so can delete this two lines.
artist = albums['artist'].replace(" ", "+") name = albums['name'].replace(" ", "+")Now you can test with this and see if you can get it to work,
i have stop here.