Abdelrhman-Elruby commited on
Commit
b1d73c1
1 Parent(s): 8dfab5d

modified: model.py

Browse files
Files changed (1) hide show
  1. model.py +2 -2
model.py CHANGED
@@ -288,6 +288,8 @@ def playlist_model(url, model, max_gen=3, same_art=5):
288
 
289
 
290
  def top_tracks(url,region):
 
 
291
  uri = url.split('/')[-1].split('?')[0]
292
  try:
293
  log.append('spotify local method')
@@ -306,8 +308,6 @@ def top_tracks(url,region):
306
  client_secret=os.environ['Client_secret']
307
  auth_manager = SpotifyClientCredentials(client_id=Client_id, client_secret=client_secret)
308
  sp = spotipy.client.Spotify(auth_manager=auth_manager)
309
- log = []
310
- Fresult = []
311
  try:
312
  log.append('Starting Spotify Model')
313
  top=sp.artist_top_tracks(uri,country=region)
 
288
 
289
 
290
  def top_tracks(url,region):
291
+ log = []
292
+ Fresult = []
293
  uri = url.split('/')[-1].split('?')[0]
294
  try:
295
  log.append('spotify local method')
 
308
  client_secret=os.environ['Client_secret']
309
  auth_manager = SpotifyClientCredentials(client_id=Client_id, client_secret=client_secret)
310
  sp = spotipy.client.Spotify(auth_manager=auth_manager)
 
 
311
  try:
312
  log.append('Starting Spotify Model')
313
  top=sp.artist_top_tracks(uri,country=region)