Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -25,6 +25,16 @@ logger = logging.getLogger(__name__)
|
|
| 25 |
|
| 26 |
app = FastAPI(title="YouTube Streaming Translator API")
|
| 27 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
# Enable CORS
|
| 29 |
app.add_middleware(
|
| 30 |
CORSMiddleware,
|
|
|
|
| 25 |
|
| 26 |
app = FastAPI(title="YouTube Streaming Translator API")
|
| 27 |
|
| 28 |
+
# Ensure ffmpeg is installed
|
| 29 |
+
def check_ffmpeg_installed():
|
| 30 |
+
try:
|
| 31 |
+
subprocess.run(["ffmpeg", "-version"], check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
| 32 |
+
return True
|
| 33 |
+
except FileNotFoundError:
|
| 34 |
+
return False
|
| 35 |
+
|
| 36 |
+
check_ffmpeg_installed()
|
| 37 |
+
|
| 38 |
# Enable CORS
|
| 39 |
app.add_middleware(
|
| 40 |
CORSMiddleware,
|