from App import bot from fastapi import UploadFile from App.Transcription.Model import Transcriptions import subprocess async def perform_background_task(file_name: str, file: UploadFile, task_id: str): data = await bot.send_file( -1001925049183, file_size=file.size, caption=file.filename, file=file_name ) # get entry and update entry: Transcriptions = await Transcriptions.objects.filter(task_id=task_id).first() await entry.update(tl_file_id=str(data.id)) def download_with_wget(link, download_dir, filename): subprocess.run(["aria2c", link, "-d", download_dir, "-o", filename])