Remove Rate Limit stuff

This appears to be handled internally to the library instead:
https://github.com/plamere/spotipy/blob/master/spotipy/client.py#L153
This commit is contained in:
David Todd (c0de) 2018-01-30 15:45:54 -06:00
parent b75cf268e8
commit eaca92b313
1 changed files with 0 additions and 15 deletions

View File

@ -68,21 +68,6 @@ while True:
# Reauth and get the next now playing
sp = authorize_api(username)
continue
if e.http_status == '429': # Too Many Requests
# We're hitting the API too fast. The response should include a "Retry-After" Header
if e.headers and e.headers["Retry-After"]:
secs = float(e.headers["Retry-After"])
print "[%.2fs] Too Many API Requests, waiting %.1fs before continuing" % \
(time.time()-start_time, secs)
# Wait X Seconds before trying again
time.sleep(secs - (time.time() - start_time) % secs)
continue
else:
# Wait 30 secs
print "[%.2fs] Too Many API Requests and No Retry-After Header, \
waiting 30s before continuing" % (time.time()-start_time)
time.sleep(30.0 - (time.time() - start_time) % 30.0)
continue
else:
raise Exception(e)