sreepathi-ravikumar commited on
Commit
bb94333
·
verified ·
1 Parent(s): b505265

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -21
app.py CHANGED
@@ -224,33 +224,14 @@ class GeneratedMathScene(Scene):
224
  def home():
225
  return "Flask Manim Video Generator is Running"
226
 
227
- @app.route("/generate", methods=["POST", "OPTIONS"])
228
  def generate_video():
229
- # Handle preflight
230
- if request.method == "OPTIONS":
231
- return '', 204
232
-
233
  try:
234
- # Optional: Check API key
235
- api_key = request.headers.get('X-API-KEY')
236
- if api_key and api_key != API_KEY:
237
- return jsonify({"error": "Invalid API key"}), 401
238
-
239
- # Get JSON data
240
-
241
-
242
-
243
  raw_data = request.get_json()
244
- raw_body=raw_data.get("jsondata" , '').strip()
245
  print(f"Raw body length: {len(raw_body)}")
246
  print(f"First 200 chars: {raw_body[:200]}")
247
 
248
-
249
-
250
- # ... (your existing raw_body handling)
251
-
252
-
253
-
254
  lst = raw_body.split("&&&&")
255
  cleaned = re.sub(r'(\d)\s*\.\s*(\d)', r'\1.\2', lst[0])
256
  nlist = ast.literal_eval(cleaned)
 
224
  def home():
225
  return "Flask Manim Video Generator is Running"
226
 
227
+ @app.route("/generate", methods=["POST"])
228
  def generate_video():
 
 
 
 
229
  try:
 
 
 
 
 
 
 
 
 
230
  raw_data = request.get_json()
231
+ raw_body=raw_data.get("jsondata" , '')
232
  print(f"Raw body length: {len(raw_body)}")
233
  print(f"First 200 chars: {raw_body[:200]}")
234
 
 
 
 
 
 
 
235
  lst = raw_body.split("&&&&")
236
  cleaned = re.sub(r'(\d)\s*\.\s*(\d)', r'\1.\2', lst[0])
237
  nlist = ast.literal_eval(cleaned)