Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,16 +1,16 @@
|
|
| 1 |
-
from
|
| 2 |
-
import subprocess
|
| 3 |
|
| 4 |
-
app =
|
| 5 |
|
| 6 |
-
@app.
|
| 7 |
-
def
|
| 8 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
result = subprocess.run(["ffmpeg", "-version"], capture_output=True, text=True)
|
| 14 |
-
return {"ffmpeg_version": result.stdout.splitlines()[0]} # Return only the first line
|
| 15 |
-
except FileNotFoundError:
|
| 16 |
-
return {"error": "FFmpeg is not installed or not found in PATH"}
|
|
|
|
| 1 |
+
from flask import Flask, request, jsonify
|
|
|
|
| 2 |
|
| 3 |
+
app = Flask(__name__)
|
| 4 |
|
| 5 |
+
@app.route('/webhook', methods=['POST'])
|
| 6 |
+
def webhook():
|
| 7 |
+
# Get the JSON data from the request
|
| 8 |
+
data = request.get_json()
|
| 9 |
+
# Log the JSON data to the console
|
| 10 |
+
print("Received JSON:", data)
|
| 11 |
+
# Respond back with a simple JSON message
|
| 12 |
+
return jsonify({"status": "success", "message": "Data received"}), 200
|
| 13 |
|
| 14 |
+
if __name__ == '__main__':
|
| 15 |
+
# Run the Flask server on port 5000 with debug mode enabled
|
| 16 |
+
app.run(debug=True, port=5000)
|
|
|
|
|
|
|
|
|
|
|
|