Yuuki0125 commited on
Commit
70af852
·
verified ·
1 Parent(s): b9f7644

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +12 -5
main.py CHANGED
@@ -12,7 +12,19 @@ async def download_video(api_key: str):
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:
@@ -32,8 +44,3 @@ async def download_video(api_key: str, url_ph: str):
32
  raise HTTPException(status_code=500, detail=f"Error: {e}")
33
  else:
34
  return {"respon": "API Lu Mana?"}
35
-
36
- if __name__ == "__main__":
37
- import uvicorn
38
-
39
- uvicorn.run(app, host="127.0.0.1", port=8000)
 
12
  if API == api_key:
13
  try:
14
  subprocess.run(['python', phdler_path], check=True)
15
+ return {"respon": "Berhasil!"}
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/Running")
22
+ async def download_video(api_key: str):
23
+ API = (api_key)
24
+ if API == api_key:
25
+ try:
26
  subprocess.run(['python', phdler_path, 'start'], check=True)
27
+ return {"respon": "Berhasil!"}
28
  except subprocess.CalledProcessError as e:
29
  raise HTTPException(status_code=500, detail=f"Error: {e}")
30
  else:
 
44
  raise HTTPException(status_code=500, detail=f"Error: {e}")
45
  else:
46
  return {"respon": "API Lu Mana?"}