Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -35,7 +35,7 @@ def get_spotify_token():
|
|
| 35 |
headers={'Content-Type': 'application/x-www-form-urlencoded'},
|
| 36 |
data={'grant_type': 'client_credentials'},
|
| 37 |
auth=(client_id, client_secret)
|
| 38 |
-
|
| 39 |
if response.status_code == 200:
|
| 40 |
return response.json().get('access_token')
|
| 41 |
|
|
@@ -57,7 +57,7 @@ def make_spotify_request(url, params=None):
|
|
| 57 |
if response.status_code == 429:
|
| 58 |
print(f"⚠️ Límite de tasa alcanzado. Cliente: {current_client_index}")
|
| 59 |
rotate_client()
|
| 60 |
-
time.sleep(int(response.headers.get('Retry-After', 10)) # Espera mínima de 10 segundos
|
| 61 |
continue
|
| 62 |
|
| 63 |
if response.status_code == 200:
|
|
|
|
| 35 |
headers={'Content-Type': 'application/x-www-form-urlencoded'},
|
| 36 |
data={'grant_type': 'client_credentials'},
|
| 37 |
auth=(client_id, client_secret)
|
| 38 |
+
)
|
| 39 |
if response.status_code == 200:
|
| 40 |
return response.json().get('access_token')
|
| 41 |
|
|
|
|
| 57 |
if response.status_code == 429:
|
| 58 |
print(f"⚠️ Límite de tasa alcanzado. Cliente: {current_client_index}")
|
| 59 |
rotate_client()
|
| 60 |
+
time.sleep(int(response.headers.get('Retry-After', 10))) # Espera mínima de 10 segundos
|
| 61 |
continue
|
| 62 |
|
| 63 |
if response.status_code == 200:
|