0
I’m doing a project to download videos from a website and store them in a folder on the computer.
Here’s the thing, I got a route @app.route('/baixar', methods=['POST'])
who is responsible for downloading video and redirecting the user.
Only I wish the user didn’t wait until the video downloaded to be redirected. Is there a way to download under the table?
The code:
@app.route('/baixar', methods=['POST'])
def baixar():
nome_video = request.args.get('nome_video')
id_video = request.args.get('id_video')
url_video = "url aqui"
download_file(url_video, nome_video),
return redirect(url_for('index'))
I want you to download it without crashing the flask
Use the asyncrono feature of Python itself or use Celery.
– Guilherme Lima
@Guilhermelima can recommend me articles on ansicronia in python? I’ve read about Celery I just think it’s a lot for something so simple.
– Joa Roque
https://docs.python.org/3/library/asyncio-task.html
– Guilherme Lima