I had a script that ran for about ~1hr.
df is a data frame created by rows I queried from my own Postgres database. I'm iterating over that to get the artist_name value and make the API call.
There are ~47k records in that table.
After an hour or so, the script stopped giving me any responses. There are no errors.
The line that breaks is results = artist_albums(...)
Putting a breakpoint() before works but once that line runs, It stops. No status errors, 429, etc...
Did I hit the Spotipy API too much?
for idx, val in enumerate(df['artist_name']):
#get albums for each artist
results = artist_albums('spotify:artist:'+df['artist_name'], album_type='album')
albums = results['items']
while results['next']:
results = spotify.next(results)
albums.extend(results['items'])
sleep(0.5)
for album in albums:
print(album['name'])
try:
q = (album['name'],
album['id'],
album['uri'],
album['release_date'],
album['release_date_precision'],
album['total_tracks'],
album['artists'][0]['id'],
album['type'],
album['external_urls']['spotify']
)
)
cur.execute("""insert into schema.table values (
%s, %s, %s, %s, %s,
%s, %s, %s, %s)""", q)
conn.commit()
```