Chrunos commited on
Commit
f94628b
·
verified ·
1 Parent(s): 74078ba

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -0
app.py CHANGED
@@ -15,6 +15,12 @@ def search():
15
  search_results = ytmusic.search(query, filter="songs")
16
  return jsonify(search_results)
17
 
 
 
 
 
 
 
18
  @app.route('/get_artist', methods=['GET'])
19
  def get_artist():
20
  artist_id = request.args.get('id')
 
15
  search_results = ytmusic.search(query, filter="songs")
16
  return jsonify(search_results)
17
 
18
+ @app.route('/searcht', methods=['POST'])
19
+ def searcht(): query = request.json.get('query', '')
20
+ search_results = ytmusic.search(query, filter="songs")
21
+ first_song = search_results[0] if search_results else {}
22
+ return jsonify(first_song)
23
+
24
  @app.route('/get_artist', methods=['GET'])
25
  def get_artist():
26
  artist_id = request.args.get('id')