Chrunos commited on
Commit
df02fa9
·
verified ·
1 Parent(s): bba3d94

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -19,7 +19,7 @@ def search():
19
  def searcht():
20
  query = request.json.get('query', '')
21
  search_results = ytmusic.search(query, filter="songs")
22
- first_song = next((song for song in search_results if 'videoId' in song and song['videoId']), {}) if search_results else {}
23
  return jsonify(first_song)
24
 
25
  @app.route('/get_artist', methods=['GET'])
 
19
  def searcht():
20
  query = request.json.get('query', '')
21
  search_results = ytmusic.search(query, filter="songs")
22
+ first_song = search_results[0] if search_results else {}
23
  return jsonify(first_song)
24
 
25
  @app.route('/get_artist', methods=['GET'])