Spaces:
Sleeping
Sleeping
Commit
•
b4518cd
1
Parent(s):
76de0b7
Update app.py
Browse files
app.py
CHANGED
@@ -32,7 +32,13 @@ def process(input_path):
|
|
32 |
trackname = results[1]["response"]["scanmatch"]['1']['partial_fast_matches'][0]['track']['title']
|
33 |
artistname = results[1]["response"]["scanmatch"]['1']['partial_fast_matches'][0]['artists'][0]['name']
|
34 |
isrc = results[1]["response"]["scanmatch"]['1']['partial_fast_matches'][0]['track']['isrc']
|
35 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
except IndexError:
|
37 |
return "Not found. Please try again."
|
38 |
time.sleep(1)
|
|
|
32 |
trackname = results[1]["response"]["scanmatch"]['1']['partial_fast_matches'][0]['track']['title']
|
33 |
artistname = results[1]["response"]["scanmatch"]['1']['partial_fast_matches'][0]['artists'][0]['name']
|
34 |
isrc = results[1]["response"]["scanmatch"]['1']['partial_fast_matches'][0]['track']['isrc']
|
35 |
+
id_spotify = -1
|
36 |
+
for x in results[1]["response"]["scanmatch"]['1']['partial_fast_matches'][0]['track']['other_ids'] :
|
37 |
+
if x['id_type_name'] == "spotify":
|
38 |
+
id_spotify = x['id']
|
39 |
+
if id_spotify == -1:
|
40 |
+
id_spotify = "No Spotify ID found."
|
41 |
+
return trackname+" by "+artistname + " - ISRC : " + isrc + " - spotify ID : " + id_spotify
|
42 |
except IndexError:
|
43 |
return "Not found. Please try again."
|
44 |
time.sleep(1)
|