Mthrfkr commited on
Commit
002474b
·
verified ·
1 Parent(s): f428c9c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -2
app.py CHANGED
@@ -9,8 +9,14 @@ from tempfile import NamedTemporaryFile
9
  from openpyxl import Workbook
10
 
11
  # Spotify API credentials from environment variables
12
- client_ids = os.getenv("SPOTIFY_CLIENT_IDS").split(',')
13
- client_secrets = os.getenv("SPOTIFY_CLIENT_SECRETS").split(',')
 
 
 
 
 
 
14
  current_api_index = 0
15
 
16
  # Request counters
 
9
  from openpyxl import Workbook
10
 
11
  # Spotify API credentials from environment variables
12
+ client_ids = os.getenv("SPOTIFY_CLIENT_IDS")
13
+ client_secrets = os.getenv("SPOTIFY_CLIENT_SECRETS")
14
+
15
+ if not client_ids or not client_secrets:
16
+ raise ValueError("SPOTIFY_CLIENT_IDS or SPOTIFY_CLIENT_SECRETS environment variables not set.")
17
+
18
+ client_ids = client_ids.split(',')
19
+ client_secrets = client_secrets.split(',')
20
  current_api_index = 0
21
 
22
  # Request counters