Skip to content

Commit

Permalink
fix 503
Browse files Browse the repository at this point in the history
  • Loading branch information
tcardonne committed Mar 29, 2019
1 parent bd75a0a commit b80c985
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions scrapper/getsongs.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ def request_spotify(path):
print("Hit RateLimit - waiting ", r.headers['Retry-After'], "secs")
time.sleep(int(r.headers['Retry-After']))
return request_spotify(path)
elif r.status_code == 503:
print("Spotify - Service Unavailable, retry 1 sec")
time.sleep(1)
return request_spotify(path)
elif r.status_code != 200:
print(r.text)
raise Exception("non 200 return from spotify")
Expand Down

0 comments on commit b80c985

Please sign in to comment.