Running the following code to fetch list of playlists:
while len(playlists) < 100000:
for word, _ in word_counts.most_common():
if not word in words_seen:
words_seen.add(word)
print('word>', word)
for playlist in find_playlists(session, word):
if playlist['id'] in playlists:
dupes += 1
elif playlist['name'] and playlist['owner']:
playlists[playlist['id']] = {
'owner': playlist['owner']['id'],
'name': playlist['name'],
'id': playlist['id'],
}
count += 1
for token in tokenize(playlist['name'], lowercase=True):
word_counts[token] += 1
break
Running the following code to fetch list of playlists:
After a while, I get the following error:
HTTP Error for GET to https://api.spotify.com/v1/search?query=a&type=playlist&market=PT&offset=1000&limit=50 returned 404 due to Not found.
Shouldn't the code skip that request whenever this happens ?