Yuuki0125 commited on
Commit
87dc8f6
·
verified ·
1 Parent(s): bcf064f

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +12 -0
main.py CHANGED
@@ -6,6 +6,18 @@ app = FastAPI()
6
 
7
  phdler_path = 'phdler.py'
8
 
 
 
 
 
 
 
 
 
 
 
 
 
9
  @app.get("/AnotherAPI/{api_key}/PH/Downloader")
10
  async def download_video(api_key: str, url_ph: str):
11
  url = url_ph
 
6
 
7
  phdler_path = 'phdler.py'
8
 
9
+ @app.get("/AnotherAPI/{api_key}/PH/Start")
10
+ async def download_video(api_key: str):
11
+ API = (api_key)
12
+ if API == api_key:
13
+ try:
14
+ subprocess.run(['python', phdler_path], check=True)
15
+ subprocess.run(['python', phdler_path, 'start'], check=True)
16
+ except subprocess.CalledProcessError as e:
17
+ raise HTTPException(status_code=500, detail=f"Error: {e}")
18
+ else:
19
+ return {"respon": "API Lu Mana?"}
20
+
21
  @app.get("/AnotherAPI/{api_key}/PH/Downloader")
22
  async def download_video(api_key: str, url_ph: str):
23
  url = url_ph