From f7239a90f17cbc74bc593fb78f9bd27c798ea490 Mon Sep 17 00:00:00 2001 From: TylerCG <117808427+TylerCG@users.noreply.github.com> Date: Tue, 22 Apr 2025 22:41:22 -0400 Subject: [PATCH] test --- app/download.py | 10 ++++------ app/main.py | 6 +++++- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/app/download.py b/app/download.py index 2688b31..5d2b3ac 100644 --- a/app/download.py +++ b/app/download.py @@ -69,12 +69,10 @@ class dropout(): 'writesubtitles': True, # Download subtitles 'subtitleslangs': ['en'] # Specify the language for subtitles (e.g., 'en' for English) } - try: - with yt_dlp.YoutubeDL(dl_ops) as ydl: - ydl.download([url]) - return JSONResponse(status_code=200, content={"status": "success", "message": "Download completed."}) - except Exception as e: - return JSONResponse(status_code=500, content={"status": "error", "message": str(e)}) + with yt_dlp.YoutubeDL(dl_ops) as ydl: + ydl.download([url]) + + def series(): json_data=[] diff --git a/app/main.py b/app/main.py index 37be4b2..d4c7297 100644 --- a/app/main.py +++ b/app/main.py @@ -32,7 +32,11 @@ async def dropoutSeries(): @app.post("/dropoutDownload") async def dropoutDownload(show: str, season: str, episode: str = None): - download.dropout.show(show,season,episode) + try: + download.dropout.show(show,season,episode) + return JSONResponse(status_code=200, content={"status": "success", "message": "Series downloading."}) + except Exception as e: + return JSONResponse(status_code=500, content={"status": "error", "message": str(e)}) @app.post("/ydl") async def ydl(url: str, location: str):