Spaces:
Paused
Paused
Update app2.py
Browse files
app2.py
CHANGED
|
@@ -923,4 +923,26 @@ if __name__ == "__main__":
|
|
| 923 |
print("⚠️ Warning: Suno API key not found.")
|
| 924 |
print("Please set the 'SUNO_API_KEY' environment variable:")
|
| 925 |
print(" - For Hugging Face Spaces: Add as Repository Secret")
|
| 926 |
-
print(" - For local development: Create a
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 923 |
print("⚠️ Warning: Suno API key not found.")
|
| 924 |
print("Please set the 'SUNO_API_KEY' environment variable:")
|
| 925 |
print(" - For Hugging Face Spaces: Add as Repository Secret")
|
| 926 |
+
print(" - For local development: Create a .env file with SUNO_API_KEY=your_key")
|
| 927 |
+
print(" - Or set it directly: export SUNO_API_KEY=your_key")
|
| 928 |
+
print("\nCurrent environment variables:")
|
| 929 |
+
for key, value in os.environ.items():
|
| 930 |
+
if 'SUNO' in key.upper() or 'API' in key.upper():
|
| 931 |
+
print(f" {key}: {'*' * len(value) if 'KEY' in key.upper() else value}")
|
| 932 |
+
|
| 933 |
+
# Launch settings
|
| 934 |
+
launch_config = {
|
| 935 |
+
"server_name": os.environ.get("GRADIO_SERVER_NAME", "0.0.0.0"),
|
| 936 |
+
"server_port": int(os.environ.get("GRADIO_SERVER_PORT", 7860)),
|
| 937 |
+
"share": os.environ.get("GRADIO_SHARE", "False").lower() == "true",
|
| 938 |
+
}
|
| 939 |
+
|
| 940 |
+
print(f"\n🚀 Starting Suno Music Generator...")
|
| 941 |
+
print(f"🌐 Local URL: http://localhost:{launch_config['server_port']}")
|
| 942 |
+
print(f"🎯 PHP Callback URL: {config.php_callback_url} (private)")
|
| 943 |
+
print(f"📁 Upload Directory: {config.upload_dir.absolute()}")
|
| 944 |
+
print(f"🎧 Playlist: https://1hit.no/cover/playlist.php")
|
| 945 |
+
print(f"📝 Logs: suno_generator.log")
|
| 946 |
+
print(f"🧹 Auto-cleanup: Uploads older than 24 hours")
|
| 947 |
+
|
| 948 |
+
app.launch(**launch_config)
|