zenjoul80 commited on
Commit
04f6d2f
·
verified ·
1 Parent(s): 1e057f2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -46,9 +46,9 @@ def callback():
46
 
47
  return jsonify({"status": "ok"}), 200
48
 
49
- @app.route('/get_music/<filename>')
50
- def get_music(filename):
51
- return send_from_directory(MUSIC_FOLDER, filename, as_attachment=True)
52
 
53
  @socketio.on('save_token')
54
  def save_token(data):
@@ -66,7 +66,7 @@ def handle_gen(payload):
66
 
67
  # DOCKER FIX: Use the 'origin' header if available to set callback
68
  # If on HF, request.host_url works, but we provide a fallback
69
- callback_base = request.host_url.replace("0.0.0.0", "direct-url-here")
70
  payload['callBackUrl'] = callback_base + "callback"
71
 
72
  try:
 
46
 
47
  return jsonify({"status": "ok"}), 200
48
 
49
+ @app.route('/get_music')
50
+ def get_music():
51
+ return send_from_directory(MUSIC_FOLDER, as_attachment=True)
52
 
53
  @socketio.on('save_token')
54
  def save_token(data):
 
66
 
67
  # DOCKER FIX: Use the 'origin' header if available to set callback
68
  # If on HF, request.host_url works, but we provide a fallback
69
+ callback_base = request.host_url.replace("https://zenjoul80-suno-api.hf.space")
70
  payload['callBackUrl'] = callback_base + "callback"
71
 
72
  try: