test
This commit is contained in:
parent
56fe5bdfcb
commit
347c4fcb57
@ -101,7 +101,7 @@ class dropout():
|
||||
with yt_dlp.YoutubeDL(dl_opts) as ydl:
|
||||
ydl.download([entry['webpage_url']])
|
||||
|
||||
def special(show, season, episode_start):
|
||||
def specials(show, season, episode_start):
|
||||
directory = f'/tv/{show}/Specials/'
|
||||
if not os.path.exists(directory):
|
||||
os.makedirs(directory)
|
||||
|
||||
15
app/main.py
15
app/main.py
@ -15,7 +15,7 @@ loop = asyncio.get_running_loop()
|
||||
|
||||
|
||||
# api
|
||||
@app.get("/dropoutUpdate")
|
||||
@app.get("/dropout/update")
|
||||
async def dropoutUpdate():
|
||||
try:
|
||||
download.dropout.series()
|
||||
@ -23,7 +23,7 @@ async def dropoutUpdate():
|
||||
except Exception as e:
|
||||
return JSONResponse(status_code=500, content={"status": "error", "message": str(e)})
|
||||
|
||||
@app.get("/dropoutSeries")
|
||||
@app.get("/dropout/series")
|
||||
async def dropoutSeries():
|
||||
file_path = Path("/data/dropout.json")
|
||||
if file_path.exists():
|
||||
@ -32,7 +32,7 @@ async def dropoutSeries():
|
||||
return JSONResponse(content=data)
|
||||
return JSONResponse(content={"error": "File not found"}, status_code=404)
|
||||
|
||||
@app.post("/dropoutDownload")
|
||||
@app.post("/dropout/download")
|
||||
async def dropoutDownload(show: str, season: str, episode: str = None):
|
||||
try:
|
||||
await loop.run_in_executor(None, partial(download.dropout.show,show,season,episode))
|
||||
@ -41,6 +41,15 @@ async def dropoutDownload(show: str, season: str, episode: str = None):
|
||||
except Exception as e:
|
||||
return JSONResponse(status_code=500, content={"status": "error", "message": str(e)})
|
||||
|
||||
@app.post("/dropout/download/specials")
|
||||
async def dropoutDownload(show: str, season: str, episode: str = None):
|
||||
try:
|
||||
await loop.run_in_executor(None, partial(download.dropout.specials,show,season,episode))
|
||||
# download.dropout.show(show,season,episode)
|
||||
return JSONResponse(status_code=200, content={"status": "success", "message": "Series downloaded."})
|
||||
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):
|
||||
try:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user