Update app.py
Browse files
app.py
CHANGED
@@ -117,7 +117,8 @@ async def match():
|
|
117 |
title = track_info["entitiesByUniqueId"][entityUniqueId]["title"]
|
118 |
search_results = ytmusic.search(title, filter="songs")
|
119 |
first_song = next((song for song in search_results if 'videoId' in song and song['videoId']), {}) if search_results else {}
|
120 |
-
|
|
|
121 |
ym_url = f'https://www.youtube.com/watch?v={videoId}'
|
122 |
return {"filename": {title}, "url": ym_url}
|
123 |
|
|
|
117 |
title = track_info["entitiesByUniqueId"][entityUniqueId]["title"]
|
118 |
search_results = ytmusic.search(title, filter="songs")
|
119 |
first_song = next((song for song in search_results if 'videoId' in song and song['videoId']), {}) if search_results else {}
|
120 |
+
song_json = jsonify(first_song)
|
121 |
+
videoId = song_json["videoId"]
|
122 |
ym_url = f'https://www.youtube.com/watch?v={videoId}'
|
123 |
return {"filename": {title}, "url": ym_url}
|
124 |
|