Spaces:
Paused
Paused
Update main.py
Browse files
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
|