minor fixes
This commit is contained in:
@ -71,7 +71,9 @@ async def is_task_already_done_or_exist(redis: RedisClient, link: str):
|
||||
|
||||
if len(tasks) > 0:
|
||||
task = tasks[0]
|
||||
return task
|
||||
if os.path.exists(os.path.join(os.getcwd(), os.pardir, os.pardir + "/downloads/" + task["result"])):
|
||||
return task
|
||||
await redis.del_task_from_task_done_queue(task)
|
||||
|
||||
|
||||
async def is_task_in_process(redis: RedisClient, link: str):
|
||||
@ -145,7 +147,7 @@ async def download_video(file_path):
|
||||
with open(base_download_dir + f'/{file_path}', mode="rb") as file_like:
|
||||
yield from file_like
|
||||
|
||||
return StreamingResponse(iterfile(), media_type="video/mp4")
|
||||
return StreamingResponse(iterfile(), headers={'Content-Disposition': f'inline; filename="{file_path}"'}, media_type="video")
|
||||
|
||||
|
||||
@app.post('/check/', response_class=FileResponse, status_code=200)
|
||||
|
Reference in New Issue
Block a user