File size: 506 Bytes
94ecfcc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
from fastapi import FastAPI, HTTPException
import subprocess

def run_python_verbose():
    try:
        # Run the 'python -v' command in a subprocess
        print("okk")
        subprocess.run(['python', 'ytdlbot/ytdl_bot.py'], check=True)
    except subprocess.CalledProcessError as e:
        print(f"Error running 'python -v': {e}")

# Call the function

app = FastAPI()

@app.get("/")
async def root():
    return {"message": "Hello World"}
@app.get("/okk")
async def okk():
    run_python_verbose()