Curso_teshuaaa / fix_server.py
Tu Nombre
🚀 Fix: Exportación de hilo + Hotmart activo
f2959c0
Raw
History Blame Contribute Delete
604 Bytes
import os
with open('main.py', 'r') as f:
contenido = f.read()
# Hacemos que el tema sea opcional para evitar el error 422
contenido = contenido.replace('class VideoReq(BaseModel): tema: str', 'class VideoReq(BaseModel): tema: str = "Revelación Espiritual"')
# Unificamos la ruta para que sea compatible con el bot (GET y POST)
if '@app.post("/api/generar")' in contenido:
contenido = contenido.replace('@app.post("/api/generar")', '@app.get("/forja_video_gancho")\n@app.post("/forja_video_gancho")')
with open('main.py', 'w') as f:
f.write(contenido)
print("✅ Servidor sincronizado")