Chrunos commited on
Commit
6a2ee0b
·
verified ·
1 Parent(s): 08c65c8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
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
- videoId = jsonify(first_song)["videoId"]
 
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