Spaces:
Build error
Build error
Remove yaml file
Browse files
model.py
CHANGED
|
@@ -16,8 +16,6 @@ spotify_client_id = os.getenv("CLIENT_ID")
|
|
| 16 |
spotify_client_secret = os.getenv("CLIENT_SECRET")
|
| 17 |
|
| 18 |
def get_track_info(track_uri):
|
| 19 |
-
stream = open("Spotify.yaml")
|
| 20 |
-
spotify_details = yaml.safe_load(stream)
|
| 21 |
auth_manager = SpotifyClientCredentials(client_id=spotify_client_id, client_secret=spotify_client_secret)
|
| 22 |
|
| 23 |
sp = spotipy.client.Spotify(auth_manager=auth_manager)
|
|
@@ -35,8 +33,6 @@ def get_track_info(track_uri):
|
|
| 35 |
def get_track_names(playlist_id):
|
| 36 |
track_names = []
|
| 37 |
|
| 38 |
-
stream = open("Spotify.yaml")
|
| 39 |
-
spotify_details = yaml.safe_load(stream)
|
| 40 |
auth_manager = SpotifyClientCredentials(client_id=spotify_client_id, client_secret=spotify_client_secret)
|
| 41 |
|
| 42 |
sp = spotipy.client.Spotify(auth_manager=auth_manager)
|
|
@@ -79,8 +75,6 @@ def search_spotify(query):
|
|
| 79 |
log = []
|
| 80 |
try:
|
| 81 |
log.append('spotify local method')
|
| 82 |
-
stream = open("Spotify.yaml")
|
| 83 |
-
spotify_details = yaml.safe_load(stream)
|
| 84 |
auth_manager = SpotifyClientCredentials(client_id=spotify_client_id, client_secret=spotify_client_secret)
|
| 85 |
except:
|
| 86 |
log.append('spotify .streamlit method')
|
|
@@ -105,8 +99,6 @@ def playlist_model(url, model, max_gen=3, same_art=5):
|
|
| 105 |
uri = url.split('/')[-1].split('?')[0]
|
| 106 |
try:
|
| 107 |
log.append('spotify local method')
|
| 108 |
-
stream = open("Spotify.yaml")
|
| 109 |
-
spotify_details = yaml.safe_load(stream)
|
| 110 |
auth_manager = SpotifyClientCredentials(client_id=spotify_client_id, client_secret=spotify_client_secret)
|
| 111 |
except:
|
| 112 |
log.append('spotify .streamlit method')
|
|
@@ -380,8 +372,6 @@ def top_tracks(url,region):
|
|
| 380 |
uri = url.split('/')[-1].split('?')[0]
|
| 381 |
try:
|
| 382 |
log.append('spotify local method')
|
| 383 |
-
stream = open("Spotify.yaml")
|
| 384 |
-
spotify_details = yaml.safe_load(stream)
|
| 385 |
auth_manager = SpotifyClientCredentials(client_id=spotify_client_id, client_secret=spotify_client_secret)
|
| 386 |
except:
|
| 387 |
log.append('spotify .streamlit method')
|
|
@@ -414,8 +404,6 @@ def song_model(url, model, max_gen=3, same_art=5):
|
|
| 414 |
uri = url.split('/')[-1].split('?')[0]
|
| 415 |
try:
|
| 416 |
log.append('spotify local method')
|
| 417 |
-
stream = open("Spotify.yaml")
|
| 418 |
-
spotify_details = yaml.safe_load(stream)
|
| 419 |
auth_manager = SpotifyClientCredentials(client_id=spotify_client_id, client_secret=spotify_client_secret)
|
| 420 |
except:
|
| 421 |
log.append('spotify .streamlit method')
|
|
|
|
| 16 |
spotify_client_secret = os.getenv("CLIENT_SECRET")
|
| 17 |
|
| 18 |
def get_track_info(track_uri):
|
|
|
|
|
|
|
| 19 |
auth_manager = SpotifyClientCredentials(client_id=spotify_client_id, client_secret=spotify_client_secret)
|
| 20 |
|
| 21 |
sp = spotipy.client.Spotify(auth_manager=auth_manager)
|
|
|
|
| 33 |
def get_track_names(playlist_id):
|
| 34 |
track_names = []
|
| 35 |
|
|
|
|
|
|
|
| 36 |
auth_manager = SpotifyClientCredentials(client_id=spotify_client_id, client_secret=spotify_client_secret)
|
| 37 |
|
| 38 |
sp = spotipy.client.Spotify(auth_manager=auth_manager)
|
|
|
|
| 75 |
log = []
|
| 76 |
try:
|
| 77 |
log.append('spotify local method')
|
|
|
|
|
|
|
| 78 |
auth_manager = SpotifyClientCredentials(client_id=spotify_client_id, client_secret=spotify_client_secret)
|
| 79 |
except:
|
| 80 |
log.append('spotify .streamlit method')
|
|
|
|
| 99 |
uri = url.split('/')[-1].split('?')[0]
|
| 100 |
try:
|
| 101 |
log.append('spotify local method')
|
|
|
|
|
|
|
| 102 |
auth_manager = SpotifyClientCredentials(client_id=spotify_client_id, client_secret=spotify_client_secret)
|
| 103 |
except:
|
| 104 |
log.append('spotify .streamlit method')
|
|
|
|
| 372 |
uri = url.split('/')[-1].split('?')[0]
|
| 373 |
try:
|
| 374 |
log.append('spotify local method')
|
|
|
|
|
|
|
| 375 |
auth_manager = SpotifyClientCredentials(client_id=spotify_client_id, client_secret=spotify_client_secret)
|
| 376 |
except:
|
| 377 |
log.append('spotify .streamlit method')
|
|
|
|
| 404 |
uri = url.split('/')[-1].split('?')[0]
|
| 405 |
try:
|
| 406 |
log.append('spotify local method')
|
|
|
|
|
|
|
| 407 |
auth_manager = SpotifyClientCredentials(client_id=spotify_client_id, client_secret=spotify_client_secret)
|
| 408 |
except:
|
| 409 |
log.append('spotify .streamlit method')
|