minor fixes

This commit is contained in:
2023-09-26 16:32:36 +03:00
committed by nikili0n
parent 82a951f715
commit fd874b4cd8
3 changed files with 10 additions and 2 deletions

View File

@ -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)