Update main.py
This commit is contained in:
parent
26dc647fb8
commit
fd3b5dfb4a
15
app/main.py
15
app/main.py
@ -1,4 +1,4 @@
|
||||
from fastapi import FastAPI, Request
|
||||
from fastapi import FastAPI, Request, Form
|
||||
from fastapi.responses import HTMLResponse, JSONResponse
|
||||
from fastapi.templating import Jinja2Templates
|
||||
# from fastapi.staticfiles import StaticFiles
|
||||
@ -6,6 +6,7 @@ from fastapi.templating import Jinja2Templates
|
||||
from pathlib import Path
|
||||
from functools import partial
|
||||
import json, download, asyncio
|
||||
from typing import Optional
|
||||
|
||||
app = FastAPI()
|
||||
|
||||
@ -33,7 +34,11 @@ async def dropoutSeries():
|
||||
return JSONResponse(content={"error": "File not found"}, status_code=404)
|
||||
|
||||
@app.post("/dropout/download")
|
||||
async def dropoutDownload(show: str, season: str, episode: str = None):
|
||||
async def dropoutDownload(
|
||||
show: str = Form(...),
|
||||
season: int = Form(...),
|
||||
episode: Optional[int] = Form(None)
|
||||
):
|
||||
try:
|
||||
await loop.run_in_executor(None, partial(download.dropout.show,show,season,episode))
|
||||
# download.dropout.show(show,season,episode)
|
||||
@ -42,7 +47,11 @@ async def dropoutDownload(show: str, season: str, episode: str = None):
|
||||
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):
|
||||
async def dropoutDownload(
|
||||
show: str = Form(...),
|
||||
season: int = Form(...),
|
||||
episode: Optional[int] = Form(None)
|
||||
):
|
||||
try:
|
||||
await loop.run_in_executor(None, partial(download.dropout.specials,show,season,episode))
|
||||
# download.dropout.show(show,season,episode)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user